Open Vivi029 opened 2 years ago
See https://github.com/Hexagon/croner/issues/52#issuecomment-1040764526 for an example on how to solve this using a standard cron module.
This specific example is for months, but could easily be converted to run each 90th second or whatever, while still having the possibility to restrict hours, days etc using standard cron.
I would run each 10th second, and create a secondDiff function that checks for 90 second increments.
Hello, I need help with this library, as the title says I need to schedule something on in weird ways (every 1 minute and 20 seconds, every 4 hours and 10 minutes). I did some digging online and find some solutions for this, one of them is using multiple cron for the same task. I've tried implementing it, but it's not really working out, especially since I have to schedule according to timestamps received from another server. I've come up with a way to convert the timestamps into a cron pattern but when it comes odd timestamps such as 90 (1 minute and 30 seconds) it gets messy. The other option was to use fcron which supposedly supports these odd tasks but I couldn't find any node js implementation of it. So is there anyway I could use cron without having to use two crons, and if impossible how would I go about updating this algorithm for it to support that. Here is the algorithm I've come up with: