Skip to content

Commit

Permalink
feat(jobdetails): support executes at for bee queue
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed Mar 10, 2021
1 parent f783416 commit 03b4932
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/server/views/dashboard/jobDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ async function handler(req, res) {
return res.json(_.omit(job, 'domain', 'queue', '_events', '_eventsCount'));
}

console.log(job);
const jobState = queue.IS_BEE ? job.status : await job.getState();
job.showRetryButton = !queue.IS_BEE || jobState === 'failed';
job.retryButtonText = jobState === 'failed' ? 'Retry' : 'Trigger';
Expand Down
4 changes: 2 additions & 2 deletions src/server/views/helpers/handlebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ const helpers = {
return mapping;
},

getDelayDate(job) {
return job.timestamp ? job.timestamp : job.options.timestamp + job.delay;
getTimestamp(job) {
return job.timestamp ? job.timestamp : job.options.timestamp;
},

encodeURI(url) {
Expand Down
7 changes: 6 additions & 1 deletion src/server/views/partials/dashboard/jobDetails.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@
{{#if this.delay}}
<div class="col-sm-3">
<h5>Executes At</h5>
{{moment (getDelayDate this) "llll"}}
{{moment (add this.delay (getTimestamp this) ) "llll"}}
</div>
{{else if this.options.delay}}
<div class="col-sm-3">
<h5>Executes At</h5>
{{moment (add this.options.delay (getTimestamp this) ) "llll"}}
</div>
{{/if}}

Expand Down

0 comments on commit 03b4932

Please sign in to comment.