Skip to content

Commit 04b2bc7

Browse files
committed
Fix mixed sync/async funcs in cache
Signed-off-by: Sina Mahmoodi <[email protected]>
1 parent 09b8bfb commit 04b2bc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/cache.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Cache.prototype.getOrLoad = function (key, cb) {
4747
var self = this
4848
var account = this.lookup(key)
4949
if (account) {
50-
cb(null, account)
50+
async.nextTick(cb, null, account)
5151
} else {
5252
self._lookupAccount(key, function (err, account) {
5353
if (err) return cb(err)
@@ -102,7 +102,7 @@ Cache.prototype.flush = function (cb) {
102102
} else {
103103
next = it.hasNext
104104
it.next()
105-
done()
105+
async.nextTick(done)
106106
}
107107
}, cb)
108108
}

0 commit comments

Comments
 (0)