mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
added timestamp to record users
This commit is contained in:
@@ -257,8 +257,8 @@ var config = require('../config.js'),
|
||||
|
||||
User.active = {
|
||||
get_record : function() {
|
||||
RDB.get('global:active_user_record', function(record) {
|
||||
socket.emit('api:user.active.get_record', record);
|
||||
RDB.mget(['global:active_user_record', 'global:active_user_record_date'], function(data) {
|
||||
socket.emit('api:user.active.get_record', {record: data[0], timestamp: data[1]});
|
||||
});
|
||||
},
|
||||
|
||||
@@ -267,6 +267,7 @@ var config = require('../config.js'),
|
||||
RDB.get('global:active_user_record', function(record) {
|
||||
if (total > record) {
|
||||
RDB.set('global:active_user_record', total);
|
||||
RDB.set('global:active_user_record_date', new Date().getTime());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user