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
Determine local timezone on client #82
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This does a better job of propagating schema metadata
jonmmease
changed the title
WIP: Determine local timezone on client
Determine local timezone on client
Mar 4, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #79
Overview
This PR reworks how local timezone conversions are handled. Previously, the server used system calls (through chrono and time-rs). This is a bit slow and it means that the timezone of the server (rather than the client) is used to determine what is "local".
With this PR, the client supplies the name of their local IANA timezone. Then chrono-tz is used to convert between UTC and this IANA timezone. This will allow a single server to handle requests from multiple clients in different time zones.
This PR removes the dependency on
time-rs
and so it also removes the need to setRUSTFLAGS="--cfg=unsound_local_offset"
during compilation.Future work
The local timezone string has been added as an optional field of every Task. Currently it is always included so the finger print of a task will always include the client's timezone. A future improvement would be to only include the local timezone in tasks that actually need it. This would allow local timezone agnostic tasks to share cache entries. As it currently stands, the cache will not be shared across clients in different time zones.