rq / rq-scheduler

A lightweight library that adds job scheduling capabilities to RQ (Redis Queue)
MIT License
1.45k stars 229 forks source link

[BUG] Local timezones do not work with cronitor #232

Open cjpit opened 4 years ago

cjpit commented 4 years ago

Hi, I've noticed after deploying our cron strings were not converting to local timezone, after using master branch, with the use_local_timezone flag

I've looked at the testing for this and it seems to always check in UTC anyway, so the test is not doing what it should :)

croniter recommends to ensure you are using pytz to localize the dates before sending.

I think i have seen somewhere you are not keen on using pytz, but I think this is the only way to get proper timezones working.

I've updated the test to use pytz and it fails as per what is happening in production - would you be open to a fix?

selwin commented 4 years ago

Sorry for the late reply, since RQ no longer supports Python 2.7, we can use Python 3's builtin timezone class. PR welcome :)