SessionStore: Reduce unnecessary vertical space
parent
5fb6bc1938
commit
4060db0daf
|
@ -19,7 +19,6 @@ SessionStore.prototype.__proto__ = Store.prototype;
|
||||||
|
|
||||||
SessionStore.prototype.get = function(sid, fn) {
|
SessionStore.prototype.get = function(sid, fn) {
|
||||||
messageLogger.debug('GET ' + sid);
|
messageLogger.debug('GET ' + sid);
|
||||||
|
|
||||||
db.get('sessionstorage:' + sid, (err, sess) => {
|
db.get('sessionstorage:' + sid, (err, sess) => {
|
||||||
if (sess) {
|
if (sess) {
|
||||||
sess.cookie.expires = 'string' == typeof sess.cookie.expires ? new Date(sess.cookie.expires) : sess.cookie.expires;
|
sess.cookie.expires = 'string' == typeof sess.cookie.expires ? new Date(sess.cookie.expires) : sess.cookie.expires;
|
||||||
|
@ -36,18 +35,12 @@ SessionStore.prototype.get = function(sid, fn) {
|
||||||
|
|
||||||
SessionStore.prototype.set = function(sid, sess, fn) {
|
SessionStore.prototype.set = function(sid, sess, fn) {
|
||||||
messageLogger.debug('SET ' + sid);
|
messageLogger.debug('SET ' + sid);
|
||||||
|
|
||||||
db.set('sessionstorage:' + sid, sess);
|
db.set('sessionstorage:' + sid, sess);
|
||||||
if (fn) {
|
if (fn) process.nextTick(fn);
|
||||||
process.nextTick(fn);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
SessionStore.prototype.destroy = function(sid, fn) {
|
SessionStore.prototype.destroy = function(sid, fn) {
|
||||||
messageLogger.debug('DESTROY ' + sid);
|
messageLogger.debug('DESTROY ' + sid);
|
||||||
|
|
||||||
db.remove('sessionstorage:' + sid);
|
db.remove('sessionstorage:' + sid);
|
||||||
if (fn) {
|
if (fn) process.nextTick(fn);
|
||||||
process.nextTick(fn);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue