StatLog will now store for N days or N max/count items

This commit is contained in:
Bryan Ashby 2016-09-01 23:41:20 -06:00
parent 9d46f23c66
commit 767bddcc4b
3 changed files with 58 additions and 17 deletions

View file

@ -73,7 +73,8 @@ function userLogin(client, username, password, cb) {
StatLog.incrementUserStat(user, 'login_count', 1, callback);
},
function recordLoginHistory(callback) {
StatLog.appendSystemLogEntry('user_login_history', user.userId, 30, callback);
const LOGIN_HISTORY_MAX = 200; // history of up to last 200 callers
StatLog.appendSystemLogEntry('user_login_history', user.userId, LOGIN_HISTORY_MAX, StatLog.KeepType.Max, callback);
}
],
function complete(err) {