@@ -121,7 +121,7 @@ export class JobProcessor {
121
121
// Make sure an interval has actually been set
122
122
// Prevents race condition with 'Agenda.stop' and already scheduled run
123
123
if ( ! this . isRunning ) {
124
- log . extend ( 'process' ) ( 'JobProcessor got stopped already, returning' , this ) ;
124
+ log . extend ( 'process' ) ( 'JobProcessor got stopped already, returning' ) ;
125
125
return ;
126
126
}
127
127
@@ -482,8 +482,7 @@ export class JobProcessor {
482
482
// const a = new Error();
483
483
// console.log('STACK', a.stack);
484
484
log . extend ( 'runOrRetry' ) (
485
- 'JobProcessor got stopped already while calling runOrRetry, returning!' ,
486
- this
485
+ 'JobProcessor got stopped already while calling runOrRetry, returning!'
487
486
) ;
488
487
return ;
489
488
}
@@ -510,11 +509,22 @@ export class JobProcessor {
510
509
setTimeout ( async ( ) => {
511
510
// when job is not running anymore, just finish
512
511
if ( ! jobIsRunning ) {
512
+ log . extend ( 'runOrRetry' ) (
513
+ '[%s:%s] checkIfJobIsStillAlive detected job is not running anymore. stopping check.' ,
514
+ job . attrs . name ,
515
+ job . attrs . _id
516
+ ) ;
513
517
resolve ( ) ;
514
518
return ;
515
519
}
516
520
517
521
if ( await job . isExpired ( ) ) {
522
+ log . extend ( 'runOrRetry' ) (
523
+ '[%s:%s] checkIfJobIsStillAlive detected an expired job, killing it.' ,
524
+ job . attrs . name ,
525
+ job . attrs . _id
526
+ ) ;
527
+
518
528
reject (
519
529
new Error (
520
530
`execution of '${ job . attrs . name } ' canceled, execution took more than ${
@@ -526,6 +536,12 @@ export class JobProcessor {
526
536
}
527
537
528
538
if ( ! job . attrs . lockedAt ) {
539
+ log . extend ( 'runOrRetry' ) (
540
+ '[%s:%s] checkIfJobIsStillAlive detected a job without a lockedAt value, killing it.' ,
541
+ job . attrs . name ,
542
+ job . attrs . _id
543
+ ) ;
544
+
529
545
reject (
530
546
new Error (
531
547
`execution of '${ job . attrs . name } ' canceled, no lockedAt date found. Ensure to call touch() for long running jobs to keep them alive.`
0 commit comments