Nextdoor / ndscheduler

A flexible python library for building your own cron-like system, with REST APIs and a Web UI.
BSD 2-Clause "Simplified" License
1.08k stars 202 forks source link

Interval scheduler #80

Closed matrixx567 closed 2 years ago

matrixx567 commented 4 years ago

Hy,

NDScheduler is a great project that I've used in a MS Windows based production environment. For my requirements NDScheduler has some weeknesses for creating interval-triggered jobs.

Using the pull request ##59 as starting point I've implemented the option to create interval triggered jobs and run NDScheduler on Windows.

Changes I've made

Installation problems

Running on MS Windows

Using interval triggered jobs

For using the interval trigged jobs from the APScheduler the REST API has to be changed. I've added a parameter trigger that is a string description for the jobs (cron or interval). Then I moved all parameters that are used for the APScheduler's job trigger (like month, day_of_week, day, hour, minute) to an own dict trigger_params. For compatibility reasons I've changed the version of the API to V2.

After changing the API I've updated the UI to use the new Interval-Jobs.

The Jobs View will show the difference between an interval or cron job. jobs

Also in the Audit log a change in the trigger parameters will be shown. audit

I also add the possibility to change or create the trigger within the UI. Therfore the Add-job View and the Edit-Jobs view are adapted. job-add job-edit

At the end I updated the REST API documentation and the available tests.

sabw8217 commented 4 years ago

Hi, thanks for contributing! However, this is a pretty large PR, and it might take a while to get it reviewed. I'll try and take a look sometime this week but I think if you split this into one PR to deal with Windows and MS-SQL support and a second one to deal with the interval job, it will probably be easier to get these changes merged. In particular, adding Windows/MS-SQL support is likely to require some changes to our TravisCI config, and it's probably best to keep those as isolated as possible.