Skip to content

Commit bef9feb

Browse files
author
Brad Vogel
authored
Merge pull request #340 from roggervalf/feat-executes-at
Adding executes at detail
2 parents 1ddfaa6 + 3629847 commit bef9feb

4 files changed

Lines changed: 26 additions & 2 deletions

File tree

example/bee.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ async function main() {
2929
}
3030
});
3131

32+
// adding delayed jobs
33+
await queue
34+
.createJob({})
35+
.delayUntil(Date.now() + 60 * 1000)
36+
.save();
37+
3238
Arena(
3339
{
3440
Bee,

example/bull.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ async function main() {
2929
}
3030
});
3131

32+
// adding delayed jobs
33+
await queue.add({}, { delay: Date.now() + 60 * 1000 });
34+
3235
Arena(
3336
{
3437
Bull,

src/server/views/helpers/handlebars.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ const helpers = {
6161
return mapping;
6262
},
6363

64+
getTimestamp(job) {
65+
return job.timestamp ? job.timestamp : job.options.timestamp;
66+
},
67+
6468
encodeURI(url) {
6569
if (typeof url !== 'string') {
6670
return '';

src/server/views/partials/dashboard/jobDetails.hbs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
<h5>Timestamp</h5>
2727
{{#if this.options.timestamp}}
2828
{{moment this.options.timestamp "llll"}}
29-
{{/if}}
30-
{{#if this.timestamp}}
29+
{{else if this.timestamp}}
3130
{{moment this.timestamp "llll"}}
3231
{{/if}}
3332
</div>
@@ -46,6 +45,18 @@
4645
</div>
4746
{{/if}}
4847

48+
{{#if this.delay}}
49+
<div class="col-sm-3">
50+
<h5>Executes At</h5>
51+
{{moment (add this.delay (getTimestamp this) ) "llll"}}
52+
</div>
53+
{{else if this.options.delay}}
54+
<div class="col-sm-3">
55+
<h5>Executes At</h5>
56+
{{moment (add this.options.delay (getTimestamp this) ) "llll"}}
57+
</div>
58+
{{/if}}
59+
4960
<div class="col-sm-3">
5061
<h5>Attempts Made</h5>
5162
{{this.attemptsMade}}

0 commit comments

Comments
 (0)