mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
v3 cron: only save modified tasks
This commit is contained in:
@@ -136,7 +136,7 @@ module.exports = function cronMiddleware (req, res, next) {
|
||||
// Save user and tasks
|
||||
let toSave = [user.save()];
|
||||
tasks.forEach(task => {
|
||||
toSave.push(task.save());
|
||||
if (task.isModified()) toSave.push(task.save());
|
||||
});
|
||||
|
||||
return Bluebird.all(toSave)
|
||||
|
||||
Reference in New Issue
Block a user