mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-28 09:31:17 +01:00
fix: #7623, wait for lastonline to update on /users
This commit is contained in:
@@ -60,11 +60,14 @@ middleware.pageView = function pageView(req, res, next) {
|
|||||||
plugins.fireHook('action:middleware.pageView', { req: req });
|
plugins.fireHook('action:middleware.pageView', { req: req });
|
||||||
|
|
||||||
if (req.loggedIn) {
|
if (req.loggedIn) {
|
||||||
user.updateLastOnlineTime(req.uid);
|
|
||||||
if (req.path.startsWith('/api/users') || req.path.startsWith('/users')) {
|
if (req.path.startsWith('/api/users') || req.path.startsWith('/users')) {
|
||||||
user.updateOnlineUsers(req.uid, next);
|
async.parallel([
|
||||||
|
async.apply(user.updateOnlineUsers, req.uid),
|
||||||
|
async.apply(user.updateLastOnlineTime, req.uid),
|
||||||
|
], next);
|
||||||
} else {
|
} else {
|
||||||
user.updateOnlineUsers(req.uid);
|
user.updateOnlineUsers(req.uid);
|
||||||
|
user.updateLastOnlineTime(req.uid);
|
||||||
setImmediate(next);
|
setImmediate(next);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user