standardize some function signatures and factor out a lot of boilerplate
This commit is contained in:
@@ -59,13 +59,16 @@ Core.getSession = function (Sessions, key) {
|
||||
return user;
|
||||
};
|
||||
|
||||
Core.expireSession = function (Sessions, key) {
|
||||
var session = Sessions[key];
|
||||
if (!session) { return; }
|
||||
if (session.blobstage) {
|
||||
session.blobstage.close();
|
||||
}
|
||||
delete Sessions[key];
|
||||
Core.expireSession = function (Sessions, key, cb) {
|
||||
setTimeout(function () {
|
||||
var session = Sessions[key];
|
||||
if (!session) { return; }
|
||||
if (session.blobstage) {
|
||||
session.blobstage.close();
|
||||
}
|
||||
delete Sessions[key];
|
||||
cb(void 0, 'OK');
|
||||
});
|
||||
};
|
||||
|
||||
var isTooOld = function (time, now) {
|
||||
|
||||
Reference in New Issue
Block a user