Skip to content

Possible bug with now=undefined #8

@cama

Description

@cama

in session.js:

let clearOldSessions = co(function* () {
let not = new Date(); //possible bug with now=undefined, I guess it should
be 'now' here :)
let sessionsSize = yield client.hlenAsync("sessions");
let sessions = yield client.hgetallAsync("sessions");
for (senderId in sessions) {
let data = JSON.parse(sessions[senderId]);
if (Math.abs(now - data.lastUsed) > maxSessionAge_ms) {
client.hdelAsync("sessions", senderId);
}
}
let sessionsSizeNow = yield client.hlenAsync("sessions");
console.log('Session Size ' + sessionsSizeNow + ' items. Removed ' +
(sessionsSize - sessionsSizeNow) + ' items');
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions