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

[feat] getting future execution timeline/schedule for jobs #80

Open
Zireael opened this issue Jan 23, 2021 · 6 comments
Open

[feat] getting future execution timeline/schedule for jobs #80

Zireael opened this issue Jan 23, 2021 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Zireael
Copy link

Zireael commented Jan 23, 2021

Hi Is it possible to easily get a list of dates/times all jobs or a specific job will be executed next?

Please see below some proposed syntax and use cases/outputs:

bree.getSchedule() // outputs the earliest (1) upcoming job

>> [
      { name: "job_3457", scheduled: "2021-01-23T13:02:58.838Z" }
   ]
bree.getSchedule( { job: ["job_6573", "job_6573"] } ) // outputs the earliest (1) upcoming job for each "job_6573" and "job_6573". 

>> [
      { name: "job_3457", scheduled: "2021-01-23T13:02:58.838Z" },
      { name: "job_6573", scheduled: "2021-01-23T13:14:53.177Z" },
   ]
bree.getSchedule( { job: [ "job_6573", "job_3457" ], count: 2 } ) // outputs the earliest (2) upcoming jobs for each "job_6573" and "job_3457". 

>> [
      { name: "job_3457", scheduled: "2021-01-23T13:02:58.838Z" },
      { name: "job_6573", scheduled: "2021-01-23T13:14:53.177Z" },
      { name: "job_3457", scheduled: "2021-01-24T13:02:58.838Z" },
      { name: "job_6573", scheduled: "2021-01-27T13:14:53.177Z" },
   ]
bree.getSchedule( { dateStart: "2021-01-23T12:00:00.000Z", dateEnd: "2021-01-29T12:00:00.000Z" } ) // returns all jobs scheduled between specified dates

>> [
      { name: "job_3457", scheduled: "2021-01-23T13:02:58.838Z" },
      { name: "job_6573", scheduled: "2021-01-23T13:14:53.177Z" },
      { name: "job_3457", scheduled: "2021-01-24T13:02:58.838Z" },
      { name: "job_3457", scheduled: "2021-01-25T13:02:58.838Z" },
      { name: "job_3457", scheduled: "2021-01-26T13:02:58.838Z" },
      { name: "job_3457", scheduled: "2021-01-27T13:02:58.838Z" },
      { name: "job_6573", scheduled: "2021-01-27T13:14:53.177Z" },
      { name: "job_3457", scheduled: "2021-01-28T13:02:58.838Z" },
   ];
bree.getSchedule( { job: [ "job_6573" ], dateStart: "2021-01-23T12:00:00.000Z", dateEnd: "2021-01-29T12:00:00.000Z"} ) // returns all jobs for "job_6573" scheduled between specified dates

>> [
      { name: "job_6573", scheduled: "2021-01-23T13:14:53.177Z" },
      { name: "job_6573", scheduled: "2021-01-27T13:14:53.177Z" },
   ];
@Zireael Zireael changed the title (question) getting future execution timeline/schedule for jobs (feat) getting future execution timeline/schedule for jobs Jan 23, 2021
@shadowgate15 shadowgate15 changed the title (feat) getting future execution timeline/schedule for jobs [feat] getting future execution timeline/schedule for jobs Mar 20, 2021
@shadowgate15
Copy link
Member

A PR would be welcome for this.

@shadowgate15 shadowgate15 added enhancement New feature or request help wanted Extra attention is needed labels Mar 20, 2021
@DynamiteC
Copy link
Contributor

Use of Cron Parser can help us out? Using their feature of next and previous.

@shadowgate15
Copy link
Member

later can get next/previous, which is how we schedule all of the intervals. It is just a functionality that needs to be written.

@DynamiteC
Copy link
Contributor

Can i help?

@shadowgate15
Copy link
Member

Please do! We are always open to reviewing PR's.

@niftylettuce
Copy link
Contributor

PR welcome @DynamiteC!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants