Calculate time_since_last_sync in UTC time.#964
Conversation
Fixes issue when DST is changed between calculation.
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a DST (Daylight Saving Time) issue in the scheduler by ensuring time calculations use UTC instead of local time. This prevents incorrect time_since_last_sync calculations when DST transitions occur between sync operations.
Key Changes:
- Modified
current_timeto use UTC timezone instead of naive local time
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
auvipy
left a comment
There was a problem hiding this comment.
can you please also add test to verify the change? can you also link relevant issue as well?
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #964 +/- ##
=======================================
Coverage 88.18% 88.18%
=======================================
Files 32 32
Lines 1007 1007
Branches 105 105
=======================================
Hits 888 888
Misses 101 101
Partials 18 18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
please also check the failing tests due to this change |
|
https://docs.python.org/3/library/datetime.html#datetime.UTC was added in Python 3.11. |
auvipy
left a comment
There was a problem hiding this comment.
we still need some additional unit tests
|
I make test to this. When drafting test I noticed that |
Fixes issue when DST is changed between calculation.