Guard arr cache writes against in-flight rescans, add rescan monitor tool

A direct arr_cache_write() call mid-rescan wrote a partial snapshot that
looked like real data loss to every consumer of the cache. The guard now
lives in arr_cache_write() itself so every caller is protected, not just
arr_get_tracked_data(). arr_rescan_monitor.sh closes the resulting gap for
rescans triggered outside arr_full_rescan.sh's own trigger-and-wait path.
This commit is contained in:
Gmer4Lfe
2026-07-16 22:57:54 -04:00
parent fb13958881
commit 2c3f0b9cb1
5 changed files with 215 additions and 2 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ for arr in lidarr sonarr radarr; do
active=$(arr_active_rescan_command "$arr" "$url" "$key" "$ver")
if [[ -n "$active" ]]; then
warn "${arr^} already mid-rescan ($active) — skipping, will catch it next scheduled run"
warn "${arr^} already mid-rescan ($active) — skipping, will catch it next scheduled run (run Tools/arr_rescan_monitor.sh ${arr} to refresh its cache as soon as this one finishes instead of waiting)"
(( SKIPPED++ ))
continue
fi