Skip to content

fix(#119): Make /api/check-update non-blocking#148

Merged
kmatzen merged 1 commit intomainfrom
fix/issue-119-nonblocking-check-update
Feb 24, 2026
Merged

fix(#119): Make /api/check-update non-blocking#148
kmatzen merged 1 commit intomainfrom
fix/issue-119-nonblocking-check-update

Conversation

@kmatzen
Copy link
Copy Markdown
Owner

@kmatzen kmatzen commented Feb 24, 2026

Fixes #119

Problem: updater_check used popen("curl -s -m 10 ...") which blocks for up to 10 seconds. When called from /api/check-update, the web server thread blocks.

Fix:

  • updater_check_async(): starts a background thread for curl; returns immediately
  • updater_is_checking(): returns 1 when a check is in progress
  • API handler uses updater_check_async() instead of blocking updater_check()
  • Response includes "checking":true when curl is running in background
  • Cached result returned on subsequent requests

Result: Dashboard "Check Updates" no longer hangs for 10 seconds on poor network.

Made with Cursor

- updater_check_async(): starts background thread for curl; returns immediately
- updater_is_checking(): returns 1 when check in progress
- API handler uses check_async instead of blocking updater_check
- Response includes "checking":true when curl running in background
- Prevents HTTP handler from blocking up to 10s on slow/unreachable network

Co-authored-by: Cursor <cursoragent@cursor.com>
@kmatzen kmatzen merged commit 3efb33a into main Feb 24, 2026
1 check passed
@kmatzen kmatzen deleted the fix/issue-119-nonblocking-check-update branch February 24, 2026 06:12
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.

updater_check / api/check_update: blocks for curl timeout (10s)

1 participant