apache / openwhisk-package-alarms

Apache OpenWhisk package that can be used to create periodic, time-based alarms.
https://openwhisk.apache.org/
Apache License 2.0
24 stars 49 forks source link

Bump up cron to 1.8.2 #223

Closed upgle closed 3 years ago

upgle commented 3 years ago

Description

The cron expression 5/10 * * * * doesn't work in the alarm package using the cron library version 1.7.0. I expect it to run at 5, 15, 25, 35, 45, and 55 minutes every hour, but it only runs once at 5 minutes.

This can be solved by upgrading the latest version of the cron library.

Sample code

var CronJob = require('cron').CronJob;
var job = new CronJob('0 5/10 * * * *', function() {
  console.log('You will see this message every second', new Date());
}, null, true, 'America/Los_Angeles');
job.start();

And also I've confirmed that the alarms package using the latest cron library works well in our cluster.