lykmapipo / kue-scheduler

A job scheduler utility for kue, backed by redis and built for node.js
246 stars 47 forks source link

kue-scheduler next run calculation ignores timezone #114

Closed CristiCimpianu closed 6 years ago

CristiCimpianu commented 6 years ago

Since the lastRun doesn't contain timezone information, _getNextDateFrom will just use server/system time to calculate the next run time. changing lastRun to be a moment() in order to use lastRun.tz(timezone) would just mimic the behavior of cronTime.sendAt() so I used that instead. cronTime.sendAt() seems to also be incrementing the time by 1 second in order to make sure the returned value is in the future.