mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-03-16 00:50:28 +01:00
feat(home): add a cron job to check users account status to idle if for lang time no sign in
This commit is contained in:
@@ -259,13 +259,13 @@ exports.unIdle = function (req, res, next) {
|
||||
var user = req.user;
|
||||
|
||||
if (user) {
|
||||
if (user.score < signConfig.activeIdleAccountScore) {
|
||||
if (user.score < signConfig.idle.activeIdleAccountBasicScore) {
|
||||
return res.status(422).send({
|
||||
message: 'SERVER.SCORE_NOT_ENOUGH'
|
||||
});
|
||||
} else {
|
||||
//update score
|
||||
scoreUpdate(req, user, scoreConfig.action.activeIdleAccount, -(signConfig.activeIdleAccountScore));
|
||||
scoreUpdate(req, user, scoreConfig.action.activeIdleAccount, -(signConfig.idle.activeIdleAccountBasicScore));
|
||||
|
||||
user.status = 'normal';
|
||||
req.login(user, function (err) {
|
||||
@@ -279,7 +279,7 @@ exports.unIdle = function (req, res, next) {
|
||||
//create trace log
|
||||
traceLogCreate(req, traceConfig.action.userUnIdle, {
|
||||
user: req.user._id,
|
||||
score: signConfig.activeIdleAccountScore
|
||||
score: signConfig.idle.activeIdleAccountBasicScore
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user