SessionStore: Rename `messageLogger` to `logger`

pull/4313/head
Richard Hansen 2020-09-21 16:57:10 -04:00 committed by John McLear
parent 4060db0daf
commit 90775cec0d
1 changed files with 4 additions and 4 deletions

View File

@ -11,14 +11,14 @@ const Store = require('ep_etherpad-lite/node_modules/express-session').Store;
const db = require('ep_etherpad-lite/node/db/DB').db; const db = require('ep_etherpad-lite/node/db/DB').db;
const log4js = require('ep_etherpad-lite/node_modules/log4js'); const log4js = require('ep_etherpad-lite/node_modules/log4js');
const messageLogger = log4js.getLogger('SessionStore'); const logger = log4js.getLogger('SessionStore');
const SessionStore = module.exports = function SessionStore() {}; const SessionStore = module.exports = function SessionStore() {};
SessionStore.prototype.__proto__ = Store.prototype; SessionStore.prototype.__proto__ = Store.prototype;
SessionStore.prototype.get = function(sid, fn) { SessionStore.prototype.get = function(sid, fn) {
messageLogger.debug('GET ' + sid); logger.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;
@ -34,13 +34,13 @@ SessionStore.prototype.get = function(sid, fn) {
}; };
SessionStore.prototype.set = function(sid, sess, fn) { SessionStore.prototype.set = function(sid, sess, fn) {
messageLogger.debug('SET ' + sid); logger.debug('SET ' + sid);
db.set('sessionstorage:' + sid, sess); db.set('sessionstorage:' + sid, sess);
if (fn) process.nextTick(fn); if (fn) process.nextTick(fn);
}; };
SessionStore.prototype.destroy = function(sid, fn) { SessionStore.prototype.destroy = function(sid, fn) {
messageLogger.debug('DESTROY ' + sid); logger.debug('DESTROY ' + sid);
db.remove('sessionstorage:' + sid); db.remove('sessionstorage:' + sid);
if (fn) process.nextTick(fn); if (fn) process.nextTick(fn);
}; };