Add OPERATIONAL SAFEGUARDS headers, skip prefill during active rescans

arr_full_rescan.sh, arr_cache_prefill.sh, and arr_rescan_monitor.sh were
missing the standard SAFEGUARDS header section other Arrs_Stack/Tools
scripts have. Also: arr_cache_prefill.sh now checks for an active rescan
before fetching, instead of doing a live fetch that arr_cache_write()
would just refuse to persist anyway -- avoids wasted API calls every
30min during a long rescan. arr_rescan_monitor.sh was also missing an
actual root check despite writing cache files; added it to match
convention rather than just document a safeguard that wasn't there.
This commit is contained in:
Gmer4Lfe
2026-07-17 01:23:31 -04:00
parent bac1ef1c17
commit 976d8d84d7
3 changed files with 80 additions and 6 deletions
+18
View File
@@ -20,6 +20,24 @@
# and running them concurrently would just contend for the same disk I/O for no benefit.
#
# ==============================================================================================
# OPERATIONAL SAFEGUARDS
# ==============================================================================================
#
# Root required — required for consistency across Arrs_Stack/, no direct fs writes here
# acquire_lock "wait" — waits for a prior run to finish rather than skipping or colliding;
# a full-library rescan across three arrs can run long, worth queuing
# behind rather than silently no-op'ing
# Reachability check — check_api before touching an arr; unreachable → skip that arr only
# Active-rescan check — skips triggering a NEW rescan if one's already active on that arr
# (manual trigger, another script) — never stacks a duplicate scan,
# see Tools/arr_rescan_monitor.sh for catching up that arr's cache
# once the pre-existing scan finishes instead of waiting for next week
# Sequential only — never runs two arrs' rescans in parallel; each is a heavy full-disk
# walk and concurrent walks would just contend for the same disk I/O
# Per-arr isolation — one arr failing, timing out, or being skipped never blocks the others
# --dry-run mode — reports which arrs would be rescanned, triggers nothing
#
# ==============================================================================================
# CONFIGURATION
# ==============================================================================================
#