Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* @default {}
*/
this.updateOpts || (this.updateOpts = {})
utils.fillIn(this.updateOpts, UPDATE_OPTS_DEFAULTS)
/**
* Default options to pass to collection#destroy.
*
* @name MongoDBAdapter#removeOpts
* @type {object}
* @default {}
*/
this.removeOpts || (this.removeOpts = {})
utils.fillIn(this.removeOpts, REMOVE_OPTS_DEFAULTS)
this.client = new utils.Promise((resolve, reject) => {
MongoClient.connect(opts.uri, opts.mongoDriverOpts, (err, client) => {
if (err) {
return reject(err)
}
this._db = client.db()
resolve(this._db)
})
})
}
function createTask (fn) {
return new utils.Promise(fn).then((result) => {
taskInProcess = false
queue.shift()
setTimeout(dequeue, 0)
return result
}, (err) => {
taskInProcess = false
queue.shift()
setTimeout(dequeue, 0)
return utils.reject(err)
})
}