Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
refactor: use nextTick instead of setImmediate
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jacob Heun <[email protected]>
  • Loading branch information
jacobheun committed Feb 7, 2019
1 parent 2d780ee commit 31359aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/* :: import type {Batch, Query, QueryResult, Callback} from 'interface-datastore' */
const assert = require('assert')
const path = require('upath')
const setImmediate = require('async/setImmediate')
const nextTick = require('async/nextTick')
const each = require('async/each')
const waterfall = require('async/series')
const asyncFilter = require('interface-datastore').utils.asyncFilter
Expand Down Expand Up @@ -95,7 +95,7 @@ class S3Datastore {
if (err && err.code === 'NoSuchBucket' && this.createIfMissing) {
return this.opts.s3.createBucket({}, (err) => {
if (err) return callback(err)
setImmediate(() => this.put(key, val, callback))
nextTick(() => this.put(key, val, callback))
})
} else if (err) {
return callback(Errors.dbWriteFailedError(err))
Expand Down Expand Up @@ -367,7 +367,7 @@ class S3Datastore {
* @returns {void}
*/
close (callback /* : (err: ?Error) => void */) /* : void */ {
setImmediate(callback)
nextTick(callback)
}
}

Expand Down

0 comments on commit 31359aa

Please sign in to comment.