Skip to content

fix(#118): Make /api/update non-blocking#150

Merged
kmatzen merged 1 commit intomainfrom
fix/issue-118-nonblocking-updater-apply
Feb 24, 2026
Merged

fix(#118): Make /api/update non-blocking#150
kmatzen merged 1 commit intomainfrom
fix/issue-118-nonblocking-updater-apply

Conversation

@kmatzen
Copy link
Copy Markdown
Owner

@kmatzen kmatzen commented Feb 24, 2026

Fixes #118

Problem: updater_apply blocks the web server thread for minutes (git pull, make, sudo make install).

Fix:

  • updater_apply_async(): runs the full apply in a background thread; returns immediately
  • updater_is_applying(): returns 1 when apply is in progress
  • API handler uses updater_apply_async(), returns 202 Accepted with status message
  • apply_status protected by mutex for thread safety

Result: Dashboard update button no longer blocks the web server for minutes.

Made with Cursor

- updater_apply_async(): runs git pull, make, install in background thread
- updater_is_applying(): returns 1 when apply in progress
- API handler uses apply_async, returns 202 Accepted immediately
- Prevents web server from blocking for minutes during update
- apply_status protected by mutex for thread safety

Co-authored-by: Cursor <cursoragent@cursor.com>
@kmatzen kmatzen merged commit 1793b21 into main Feb 24, 2026
1 check passed
@kmatzen kmatzen deleted the fix/issue-118-nonblocking-updater-apply branch February 24, 2026 06:16
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_apply blocks web server thread for minutes

1 participant