Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add job fail when pass repeat.endDate #1845

Closed
nephew92 opened this issue Sep 3, 2020 · 2 comments
Closed

Add job fail when pass repeat.endDate #1845

nephew92 opened this issue Sep 3, 2020 · 2 comments

Comments

@nephew92
Copy link

nephew92 commented Sep 3, 2020

Description

When pass endDate to repeat opts the job is not add and not exception is throw

Minimal, Working Test code to reproduce the issue.

const job1 = await queue.add({
  name: 'job1'
}, {
  repeat: {
    cron: "0 * * * * *",
    startDate: "2020-09-02T22:29:00Z"
  }
})

const job2 = await queue.add({
  name: 'job2'
}, {
  repeat: {
    cron: "0 * * * * *",
    startDate: "2020-09-02T22:29:00Z",
    endDate: "2020-09-03T01:44:37Z"
  }
})

console.log(job1); //looks good, the job was added
console.log(job2); //looks bad, job2 is undefined and the job was not added. No error was throw

(An easy to reproduce test case will dramatically decrease the resolution time.)

Bull version

3.11.0 and 3.18.0

Additional information

@stale
Copy link

stale bot commented Jul 12, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 12, 2021
@stale stale bot removed the wontfix label Jul 14, 2021
@manast
Copy link
Member

manast commented Jul 14, 2021

Closing since it works as designed, if endDate has already passed no job is added to the queue, the above case works if endDate is a future date.

@manast manast closed this as completed Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants