Skip to content

DietPi-Config | Add configurable time sync timeout (CONFIG_TIMESYNC_TIMEOUT) - #8339

Draft
MichaIng with Copilot wants to merge 2 commits into
devfrom
copilot/dietpi-timesync-add-timeout-setting
Draft

MichaIng with Copilot wants to merge 2 commits into
devfrom
copilot/dietpi-timesync-add-timeout-setting

Conversation

Copilot AI commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

The time sync wait in dietpi-timesync was hardcoded to 60 seconds. On systems where the router boots alongside the SBC, the first sync can fail within that window. The wait is only adjustable via the MAX_LOOPS_CHECK env var, which the cron jobs don't pass.

  • dietpi.txt

    • New CONFIG_TIMESYNC_TIMEOUT=60, placed under CONFIG_NTP_MODE.
  • dietpi/func/dietpi-timesync

    • Run_TimeSync resolves the timeout in this order: MAX_LOOPS_CHECK env var, then CONFIG_TIMESYNC_TIMEOUT, then 60.
    • Each source is used only if it is a positive integer.
    • The boot, hourly and daily cron paths pick up the dietpi.txt value without changes to the cron scripts.
  • dietpi/dietpi-config

    • New "Time sync timeout" entry next to "Time sync mode", showing the current value in seconds.
    • Selecting it opens an input box. Non-positive-integer input shows an error and leaves the setting unchanged.
    • The existing MAX_LOOPS_CHECK=10 that dietpi-config passes for its own immediate sync after a mode change still takes precedence over the setting.
  • CHANGELOG.txt

    • Added an entry under Enhancements.
# Override via dietpi.txt
CONFIG_TIMESYNC_TIMEOUT=300

# Env var still wins for one-off runs
MAX_LOOPS_CHECK=30 /boot/dietpi/func/dietpi-timesync 1

Co-authored-by: MichaIng <28480705+MichaIng@users.noreply.github.com>
Copilot AI changed the title [WIP] Add setting to define time sync timeout DietPi-Config | Add configurable time sync timeout (CONFIG_TIMESYNC_TIMEOUT) Sep 30, 2026
Copilot AI requested a review from MichaIng September 30, 2026 21:58
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.

DietPi-TimeSync | Add setting to define time sync timeout

2 participants