web: delay cb invocation to the next tick

ref #258
This commit is contained in:
Alex Kocharin 2015-05-30 18:22:54 +03:00
parent d370e5a6a9
commit 7c822d06f6
1 changed files with 3 additions and 1 deletions

View File

@ -50,7 +50,9 @@ module.exports = function(config, auth, storage) {
if (err) throw err // that function shouldn't produce any
async.filterSeries(packages, function(package, cb) {
auth.allow_access(package.name, req.remote_user, function(err, allowed) {
cb(!err && allowed)
setImmediate(function () {
cb(!err && allowed)
})
})
}, function(packages) {
next(template({