Skip to content

Add timezone support for cron jobs #354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 18, 2022

Conversation

iamlikeme
Copy link
Contributor

This changeset ensures that calculations of execution time for cron jobs are done on timezone-aware datetime objects. Timezone can be specified by a new Worker attribute timezone which defaults to the system timezone (which preserves the current behavior).

Fixes: #351

@codecov
Copy link

codecov bot commented Oct 16, 2022

Codecov Report

Merging #354 (47a5cf9) into main (0474311) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #354   +/-   ##
=======================================
  Coverage   98.79%   98.80%           
=======================================
  Files           9        9           
  Lines         916      917    +1     
  Branches      166      166           
=======================================
+ Hits          905      906    +1     
  Misses          6        6           
  Partials        5        5           
Impacted Files Coverage Δ
arq/worker.py 99.55% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0474311...47a5cf9. Read the comment docs.

@iamlikeme iamlikeme marked this pull request as ready for review October 16, 2022 21:03
@samuelcolvin samuelcolvin merged commit 9ce2fd6 into python-arq:main Nov 18, 2022
@samuelcolvin
Copy link
Member

This is great, thanks so much.

@samuelcolvin
Copy link
Member

I spent a long time trying to get it to yield an incorrect timezone e.g. using pytz, but it seems your logic is correct. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timezone support for cron jobs
2 participants