Replace Emby dirty-sync workaround with play_state_sync in handback

Emby now runs continuously on both hosts — play_state_sync via API
handles watch state reconciliation, making the 30-min dirty rsync
redundant. Handback runs play_state_sync --wait before DNS cutover
so users land on current state after a failover event.

- Emby removed from FALLBACK_HOST1_TIER1 (always running)
- Emby dirty sync removed from HOST1_CRITICAL_SYNC_SHARES
- Emby writeback removed from FALLBACK_HOST1_WRITEBACK_TIER1
- play_state_sync gains --wait flag (uses lock wait mode for handback)
- Tier 1 emby-fallback special case removed from handback writeback loop
- play_state_sync --wait added as Step 7 in handback, before DNS cutover
This commit is contained in:
Gmer4Lfe
2026-06-22 23:14:36 -04:00
parent 438de76655
commit c4d4d8160d
2 changed files with 26 additions and 10 deletions
+16 -7
View File
@@ -772,11 +772,7 @@ run_handback() {
[[ -z "$job" ]] && continue
log "Syncing: $job"
if [[ "$DRY_RUN" == false ]]; then
if [[ "$(basename "$job")" == "Emby" ]]; then
bash "$SCRIPT_DIR/../Rsync/rsync.sh" "$job" --profile=emby-fallback
else
bash "$SCRIPT_DIR/../Rsync/rsync.sh" "$job"
fi
bash "$SCRIPT_DIR/../Rsync/rsync.sh" "$job"
else
warn "DRY RUN — would rsync: $job"
fi
@@ -797,7 +793,20 @@ run_handback() {
[[ "$is_ddns" == false ]] && remote_start "$container"
done
# ── Step 7: DNS Cutover — final step ────────────────────────────────────────────────────
# ── Step 7: Play State Sync — before DNS cutover so users land on current state ──────────
echo ""
echo "━━━ $ICON_SYNC Play State Sync ━━━"
if [[ "$DRY_RUN" == false ]]; then
if bash "$SCRIPT_DIR/../Media/play_state_sync.sh" --wait; then
log "Play state synced — $REMOTE_SERVER_NAME watch state reconciled ✅"
else
warn "play_state_sync failed — users may see stale watch state until next sync cycle"
fi
else
warn "DRY RUN — would run play_state_sync --wait"
fi
# ── Step 8: DNS Cutover — final step ────────────────────────────────────────────────────
# DNS cuts over ONLY after Tier 1 containers confirmed up
echo ""
echo "━━━ $ICON_NET DNS Cutover ━━━"
@@ -807,7 +816,7 @@ run_handback() {
done
warn "$ICON_NET Remote DDNS started — DNS now points at $REMOTE_SERVER_NAME"
# ── Step 8: Return to NORMAL ─────────────────────────────────────────────────────────────
# ── Step 9: Return to NORMAL ─────────────────────────────────────────────────────────────
echo ""
state_set state "NORMAL"
state_set fallback_start "0"