File tree Expand file tree Collapse file tree 3 files changed +34
-3
lines changed Expand file tree Collapse file tree 3 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,18 @@ async function main() {
7272
7373 // adding delayed jobs
7474 const delayedJob = await queue . add ( 'delayed' , { } , { delay : 60 * 1000 } ) ;
75+ await queue . add (
76+ 'delayed' ,
77+ { } ,
78+ {
79+ delay : 1000 ,
80+ attempts : 4 ,
81+ backoff : {
82+ type : 'exponential' ,
83+ delay : 60000 ,
84+ } ,
85+ }
86+ ) ;
7587 await queue . add ( 'cron' , { } , { repeat : { pattern : '* 1 * 1 *' } } ) ;
7688 delayedJob . log ( 'Log message' ) ;
7789
Original file line number Diff line number Diff line change @@ -76,7 +76,11 @@ const helpers = {
7676 getDelayedExecutionAt ( job ) {
7777 // Bull
7878 if ( job . delay ) {
79- return job . delay + getTimestamp ( job ) ;
79+ if ( job . processedOn ) {
80+ return job . processedOn + job . delay ;
81+ } else {
82+ return job . timestamp + job . delay ;
83+ }
8084 }
8185
8286 // Bee
Original file line number Diff line number Diff line change 4242
4343 <div class =" col-sm-3" >
4444 <h5 >Timestamp</h5 >
45- {{ #if (getTimestamp this )}}
46- {{ moment (getTimestamp this ) " llll" }}
45+ {{ #if queue.IS_BEE }}
46+ {{ #if this.options }}
47+ {{ #if (isNumber this.options.timestamp )}}
48+ {{ moment this.options.timestamp " llll" }}
49+ {{ /if }}
50+ {{ /if }}
51+ {{ else }}
52+ {{ #if (isNumber this.timestamp )}}
53+ {{ moment this.timestamp " llll" }}
54+ {{ /if }}
4755 {{ /if }}
4856 </div >
4957
7684 {{ length this.options.stacktraces }}
7785 {{ /if }}
7886 </div >
87+
88+ {{ #if (isNumber this.attemptsStarted )}}
89+ <div class =" col-sm-3" >
90+ <h5 >Attempts Started</h5 >
91+ {{ this.attemptsStarted }}
92+ </div >
93+ {{ /if }}
7994</div >
8095<div class =" row" >
8196 <div class =" col-sm-4" >
You can’t perform that action at this time.
0 commit comments