mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-04 13:09:41 +00:00
Remove catch from cron (#8963)
* Removed extra logging * Removed second extra logger * Removed extra import
This commit is contained in:
parent
1a99380a53
commit
4929a2dd79
1 changed files with 1 additions and 6 deletions
|
|
@ -5,7 +5,6 @@ import { model as Group } from '../models/group';
|
|||
import { model as User } from '../models/user';
|
||||
import { recoverCron, cron } from '../libs/cron';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import logger from '../libs/logger';
|
||||
|
||||
async function checkForActiveCron (user, now) {
|
||||
let _cronSignature = uuid();
|
||||
|
|
@ -120,17 +119,13 @@ async function cronAsync (req, res) {
|
|||
|
||||
await recoverCron(recoveryStatus, res.locals);
|
||||
} else {
|
||||
logger.error(err, {isUserUpdateErroringDuringCron: true});
|
||||
// For any other error make sure to reset _cronSignature so that it doesn't prevent cron from running
|
||||
// at the next request
|
||||
await User.update({
|
||||
_id: user._id,
|
||||
}, {
|
||||
_cronSignature: 'NOT_RUNNING',
|
||||
}).exec()
|
||||
.catch((newError) => {
|
||||
logger.error(newError, {isUserUpdateErroringDuringCron: true});
|
||||
});
|
||||
}).exec();
|
||||
|
||||
throw err; // re-throw the original error
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue