Refresh shared tracked-data cache after --move writes to avoid a stale-cache window for other scripts

This commit is contained in:
Gmer4Lfe
2026-07-17 12:08:10 -04:00
parent ca6f16bafb
commit 1777c56efa
+10
View File
@@ -352,6 +352,16 @@ if [[ "$MOVE_MODE" == true ]]; then
fi fi
done < <(echo "$MOVE_TARGETS" | jq -c '.[]') done < <(echo "$MOVE_TARGETS" | jq -c '.[]')
# arr_get_tracked_data() is cache-first — every write above changed rootFolderPath, so the
# shared cache is now stale until the next scheduled arr_cache_prefill run (up to 30min).
# Every other script reading this cache (cleanup, discovery, etc.) would see wrong data
# until then — refresh it now with one more live fetch rather than leave that window open.
if [[ "$MOVED" -gt 0 ]]; then
info "Refreshing shared tracked-data cache..."
fresh_movies=$(arr_api "$RADARR_URL" "$RADARR_API_KEY" "v3" "movie" "Radarr")
[[ -n "$fresh_movies" ]] && arr_cache_write "radarr" "$fresh_movies"
fi
echo "" echo ""
echo "━━━━━ $ICON_SUMMARY MOVE SUMMARY ━━━━━" echo "━━━━━ $ICON_SUMMARY MOVE SUMMARY ━━━━━"
echo "$ICON_SUCCESS Moved: $MOVED" echo "$ICON_SUCCESS Moved: $MOVED"