Reliably restore last session on refresh after a server restart
The page-load restore was one-shot and bailed when a completed scan's replayed scan_phase left a running flag set; sse_replay_done (the other retry) only fires for a non-empty replay buffer, which is empty after a restart — so refreshing post-update showed a blank grid despite the results being in the DB. The watchdog now retries the restore on each 4s poll while nothing is shown and no scan runs, clearing stale flags first. /api/scan/status also reports google_running separately so a refresh during a live Google scan is no longer treated as idle. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9fd1aa1f8a
commit
f84c8516df
5 files changed
+46
-13
No files matched your search
+6
-2
@@ -76,9 +76,13 @@ def scan_status():
|
||||
acquired = state._scan_lock.acquire(blocking=False)
|
||||
if acquired:
|
||||
state._scan_lock.release()
|
||||
g_acquired = state._google_scan_lock.acquire(blocking=False)
|
||||
if g_acquired:
|
||||
state._google_scan_lock.release()
|
||||
return jsonify({
|
||||
"running": not acquired,
|
||||
"scan_id": _sse_mod._current_scan_id or None,
|
||||
"running": not acquired, # M365 + file scan lock
|
||||
"google_running": not g_acquired, # Google scan lock (separate)
|
||||
"scan_id": _sse_mod._current_scan_id or None,
|
||||
})
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user