@norvento/scheduler

Please refer to https://github.com/node-schedule/node-schedule#cron-style-scheduling to see the available schedule patterns

Usage no npm install needed!

<script type="module">
  import norventoScheduler from 'https://cdn.skypack.dev/@norvento/scheduler';
</script>

README

Norvento scheduler

Config properties:

Schedule pattern:

Please refer to https://github.com/node-schedule/node-schedule#cron-style-scheduling to see the available schedule patterns

Example:

const jobTest = new JobTest("test", "test job", "*/1 * * * *");
await Scheduler.scheduleJob(jobTest);

Doc

Table of Contents

Job

Job

Parameters
execute

Method the job has to execute. The child class must overwrite this method

stop

Stops the job

start

Starts the job

reschedule

Reschedules the job with the given cron pattern

Parameters
  • cron string the cron pattern
clearErrors

Deletes all stored errors

getNextInvocation

Gets the next job invocation

addError

Adds a new error

Parameters
getErrors

Returns all the stored errors

onSuccess

Function called when the job finishes successfully

onError

Function called when the process finished because of an error

onFinish

Function called when the job finished

Scheduler

Scheduler

scheduleJob

Schedules a new job

Parameters
  • job Job the job to schedule
getJob

Gets the job with the given code

Parameters