Skip to content

Add "Execute at" in template for delayed jobs.#166

Closed
JensVanhooydonck wants to merge 2 commits into
bee-queue:masterfrom
JensVanhooydonck:ExecuteAt
Closed

Add "Execute at" in template for delayed jobs.#166
JensVanhooydonck wants to merge 2 commits into
bee-queue:masterfrom
JensVanhooydonck:ExecuteAt

Conversation

@JensVanhooydonck
Copy link
Copy Markdown

This will show the time when a delayed task will be executed.

Only tested this with Bull.

Closes #145

This will show the time when a delayed task will be executed.

Only tested this with Bull.
@JensVanhooydonck JensVanhooydonck changed the title Added Execute at in template. Add "Execute at" in template for delayed jobs. Apr 25, 2019
@sibelius
Copy link
Copy Markdown

can we get this in?

@sibelius
Copy link
Copy Markdown

screenshot of how it shows

image

you can use this patch-package for now https://gist.github.com/sibelius/a597174b1ff58c2883566693edb1fa15

until this lands

Copy link
Copy Markdown
Member

@skeggse skeggse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept lgtm.

</div>

<div class="col-sm-3">
{{#if this.delay}}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work for bee-queue jobs? this.delay would be falsy, so it wouldn't ever enter this if clause - right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I can only test this with Bull. I don't know how bee-queue will pass it's delay?
I could put the if this.delay around the div class, so it would not show any white space when there is no delay.

{{#if this.options.timestamp}}
{{moment (plus this.options.timestamp this.delay) "llll"}}
{{/if}}
{{#if this.timestamp}}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this.delay is truthy and this.timestamp is falsy, then there would just be a weird "Execute at" section with no content - right? Maybe this could be structured as:

{{#if this.options.timestamp}}
...
{{else if this.timestamp}}
...
{{else}}
Malformed job.
{{/if}}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have altered this piece. I added the same logic to the timestamp part so the code is consistent.

Also moved Execute at column in if statement. Do not show if no delay present.
bee-queue#166 (comment)
@JensVanhooydonck JensVanhooydonck requested a review from skeggse April 7, 2020 07:52
@skeggse
Copy link
Copy Markdown
Member

skeggse commented Aug 5, 2020

We don't have the bandwidth to test these changes against bee-queue, unfortunately. Happy to pick this back up if/when someone is able to verify this works for both bee-queue and bull!

@roggervalf
Copy link
Copy Markdown
Collaborator

@JensVanhooydonck could you try last version #340 was merged

@bradvogel
Copy link
Copy Markdown

I believe this was added in #340

@bradvogel bradvogel closed this Mar 23, 2021
@JensVanhooydonck
Copy link
Copy Markdown
Author

@JensVanhooydonck could you try last version #340 was merged

Sorry for the late reply.
Everything works as expected. Thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show timestamp + delay info

5 participants