Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.

Retry failed server connections at 60s cadence - #21

Merged
mondominator merged 1 commit into
mainfrom
feature/connection-retry
May 5, 2026
Merged

mondominator merged 1 commit into
mainfrom
feature/connection-retry

Conversation

@mondominator

Copy link
Copy Markdown
Owner

Summary

  • generate_server_connections now records connection failures on app_state
  • During the wait phase between sync cycles, retry failed connections every 60s while any are outstanding
  • When all servers reconnect, fire request_manual_sync so the dashboard goes green and a sync runs immediately instead of waiting for the next hourly cycle

Why

After an Unraid reboot, ferret often boots while Plex is still running startup-maintenance (HTTP 503) and Jellyfin is resetting connections. Those servers get registered as `disconnected` in the dashboard and stay red for the full `SLEEP_DURATION` (1h default) before ferret tries again. This patch self-heals within a minute of the upstream services coming back.

Test plan

  • AppState smoke test — counter increments, resets via `reset_servers()`
  • All modules compile cleanly
  • After deploy + Unraid reboot: confirm Plex/Jellyfin red dots clear within ~60s of those services becoming available, and that an immediate sync runs

🤖 Generated with Claude Code

generate_server_connections now records failures on app_state, and the
main loop's wait phase re-runs it every 60s while any are outstanding.
When all servers reconnect, fire request_manual_sync so the dashboard
goes green and a sync runs immediately instead of waiting for the next
hourly cycle. Fixes Plex/Jellyfin red dots after Unraid reboots when
those services are still in startup maintenance at ferret boot time.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mondominator
mondominator merged commit a80488b into main May 5, 2026
2 checks passed
@mondominator
mondominator deleted the feature/connection-retry branch May 5, 2026 14:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant