This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var transform = function(contents, doneTransform) { | |
var authExpiry = 60 * 60 * 1000, | |
authId = uuid.v4(), | |
authKey = 'file:auth:' + authId; | |
redis.client.set(authKey, JSON.stringify({ | |
userId: req.user.id | |
})); | |
redis.client.expire(authKey, authExpiry); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var doQuery = function() { | |
// passing an object to async.parallel will cause it to collect their results | |
// and provide them to the callback in an object with the same keys. | |
async.parallel({ | |
// functions are passed a callback with the standard argument pattern of fn(err, result) | |
count: count.exec, | |
query: query.exec | |
}, function(err, results) { |