We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6dc72fd commit e188ae6Copy full SHA for e188ae6
lib/bson/objectid.js
@@ -137,7 +137,7 @@ ObjectID.prototype.generate = function(time) {
137
}
138
139
// Use pid
140
- var pid = (typeof process === 'undefined' ? Math.floor(Math.random() * 100000) : process.pid) % 0xFFFF;
+ var pid = (typeof process === 'undefined' || process.pid === 1 ? Math.floor(Math.random() * 100000) : process.pid) % 0xFFFF;
141
var inc = this.get_inc();
142
// Buffer used
143
var buffer = new Buffer(12);
0 commit comments