mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
SessionStore: Delete unused methods all
, clear
, length
This commit is contained in:
parent
346111250e
commit
de98852da6
1 changed files with 0 additions and 44 deletions
|
@ -52,47 +52,3 @@ SessionStore.prototype.destroy = function(sid, fn) {
|
|||
process.nextTick(fn);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* RPB: the following methods are optional requirements for a compatible session
|
||||
* store for express-session, but in any case appear to depend on a
|
||||
* non-existent feature of ueberdb2
|
||||
*/
|
||||
if (db.forEach) {
|
||||
SessionStore.prototype.all = function(fn) {
|
||||
messageLogger.debug('ALL');
|
||||
|
||||
var sessions = [];
|
||||
|
||||
db.forEach(function(key, value) {
|
||||
if (key.substr(0,15) === "sessionstorage:") {
|
||||
sessions.push(value);
|
||||
}
|
||||
});
|
||||
fn(null, sessions);
|
||||
};
|
||||
|
||||
SessionStore.prototype.clear = function(fn) {
|
||||
messageLogger.debug('CLEAR');
|
||||
|
||||
db.forEach(function(key, value) {
|
||||
if (key.substr(0,15) === "sessionstorage:") {
|
||||
db.remove("session:" + key);
|
||||
}
|
||||
});
|
||||
if (fn) fn();
|
||||
};
|
||||
|
||||
SessionStore.prototype.length = function(fn) {
|
||||
messageLogger.debug('LENGTH');
|
||||
|
||||
var i = 0;
|
||||
|
||||
db.forEach(function(key, value) {
|
||||
if (key.substr(0,15) === "sessionstorage:") {
|
||||
i++;
|
||||
}
|
||||
});
|
||||
fn(null, i);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue