Skip to content
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
merged 27 commits into from Mar 4, 2022
Merged

Determine local timezone on client #82

merged 27 commits into from Mar 4, 2022

Conversation

jonmmease
Copy link
Collaborator

@jonmmease jonmmease commented Mar 3, 2022

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 set RUSTFLAGS="--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.

@jonmmease 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Determine local timezone on client instead of server
1 participant