rq / rq-scheduler

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

fixed local TZ handling - fixes #247 #248

Closed Eugeny closed 3 years ago

Eugeny commented 4 years ago

to_unix ignores TZ information - force all dates returned by get_next_scheduled_time to be TZ-aware and in the expected TZ right away.

⚠️ this adds dependency to python-dateutil for local timezone detection

BartlomiejSkwira commented 4 years ago

@selwin any chance to get this fix merged to a release?

selwin commented 4 years ago

I think the real right solution here is to get rid of use_local_timezone altogether. The scheduler should just take the datetime object, check the timezone and converts it to UTC for scheduling purposes.

If the conflict can be fixed, I'll pull this in and make a bugfix release.

Eugeny commented 4 years ago

@selwin fixed the import. Unfortunately we won't be able to get rid of use_local_tz completely, at least not in crontab schedules, since they don't have any source of tz info :(

simone6021 commented 3 years ago

Hello @selwin, kindly asking if there is any chance to see this merged?

Thanks to @Eugeny by the way.

selwin commented 3 years ago

Sorry for the delayed response. PR is merged, will make a release latest this weekend.

simone6021 commented 3 years ago

Thanks a lot Selwin.