Skip to content

mintUpdate.py: Simplify auto-refresh loop and refresh coordination.#1055

Closed
mtwebster wants to merge 3 commits intolinuxmint:masterfrom
mtwebster:refresh-loop
Closed

mintUpdate.py: Simplify auto-refresh loop and refresh coordination.#1055
mtwebster wants to merge 3 commits intolinuxmint:masterfrom
mtwebster:refresh-loop

Conversation

@mtwebster
Copy link
Copy Markdown
Member

  • Get rid of refresh-last-run, just rely on the sleep->refresh loop.
    It was overkill and caused a race condition because the refresh
    loop is on a thread and the key was being updated on the main loop.
  • Use threading.Event.wait(), which is interruptible, instead of
    sleep(), so setting changes can apply immediately, including
    changing the refresh time and toggling auto-refresh.
  • Remove the auto-refresh toggle handler, just rely on the settings-
    change handler.
  • Collect the thread handles returned from the _async decorator
    during refresh() to guard refresh_updates()

- Get rid of refresh-last-run, just rely on the sleep->refresh loop.
  It was overkill and caused a race condition because the refresh
  loop is on a thread and the key was being updated on the main loop.
- Use threading.Event.wait(), which is interruptible, instead of
  sleep(), so setting changes can apply immediately, including
  changing the refresh time and toggling auto-refresh.
- Remove the auto-refresh toggle handler, just rely on the settings-
  change handler.
- Collect the thread handles returned from the _async decorator
  during refresh() to guard refresh_updates()
@mtwebster mtwebster closed this Apr 25, 2026
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.

1 participant