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

FIX: Multiple network time issues #979

Merged
merged 7 commits into from
Jul 4, 2023
Merged

FIX: Multiple network time issues #979

merged 7 commits into from
Jul 4, 2023

Conversation

tGecko
Copy link
Member

@tGecko tGecko commented Jul 3, 2023

Fix UI freeze on network time toggle, multiple get_time calls

Let update_networking.sh run in the background when toggling NTPstate.
This means if it is toggled multiple times, it will also get run multiple times in parallel. In my testing this had no negative effects.

Fix multiple calls of get_time()

get_time() was called a few too many times for multiple reasons, tried to fix them by

  • removing function calls
  • introducing a filesystem flag to check if tz was changed when exiting tweaks

examples:

("started time update" is logged when get_time() is run)

Closing tweaks when timezone was changed:
main
main-left-tweaks-tz-changed
fix-ntp-ui-freeze
fixed-left-tweaks-tz-changed

Toggling NTP when timezone was not changed:
main
main-toggle-ntp-tz-unchanged
fix-ntp-ui-freeze
fixed-toggle-ntp-tz-unchanged

Toggling NTP when timezone was changed:
main
main-toggle-ntp-tz-changed
fix-ntp-ui-freeze
fixed-toggle-ntp-tz-changed

Try second time API before falling back to NTP

As a second fallback before using the really slow ntp, use another API (timeapi.io)

Reduce cURL timeout from 120s (default) to 5s

cURL has a crazy default timeout of 120 seconds, which would lock up the UI completely if the server doesn't respond.
To deal with is, timeout was set to 5 seconds.

tGecko and others added 2 commits July 3, 2023 20:33
- Fix UI freeze on network time toggle
- Fix uneccesary multiple calls of get_time()
- Try second time API before falling back to NTP
- Reduce cURL timeout from 120s (default) to 5s
@tGecko tGecko changed the title Fix multiple network time issues FIX: multiple network time issues Jul 3, 2023
@tGecko tGecko changed the title FIX: multiple network time issues FIX: Multiple network time issues Jul 3, 2023
Aemiii91
Aemiii91 previously approved these changes Jul 4, 2023
@Aemiii91 Aemiii91 enabled auto-merge July 4, 2023 21:16
@Aemiii91 Aemiii91 added this pull request to the merge queue Jul 4, 2023
Merged via the queue into main with commit 07cc115 Jul 4, 2023
@Aemiii91 Aemiii91 deleted the fix-ntp-ui-freeze branch July 4, 2023 21:29
@Aemiii91 Aemiii91 added the bug in onion Something isn't working label Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug in onion Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants