Skip to content

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

Description

@Zireael

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" },
   ];

Activity

  1. changed the title [-](question) getting future execution timeline/schedule for jobs[/-] [+](feat) getting future execution timeline/schedule for jobs[/+] on Jan 23, 2021
  2. changed the title [-](feat) getting future execution timeline/schedule for jobs[/-] [+][feat] getting future execution timeline/schedule for jobs[/+] on Mar 20, 2021
  3. shadowgate15 commented on Mar 20, 2021

    @shadowgate15
    Member

    A PR would be welcome for this.

  4. DynamiteC commented on Nov 9, 2021

    @DynamiteC
    Contributor

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

  5. shadowgate15 commented on Nov 9, 2021

    @shadowgate15
    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.

  6. DynamiteC commented on Nov 10, 2021

    @DynamiteC
    Contributor

    Can i help?

  7. shadowgate15 commented on Nov 10, 2021

    @shadowgate15
    Member

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

  8. niftylettuce commented on Jan 17, 2022

    @niftylettuce
    Contributor

    PR welcome @DynamiteC!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions