Refresh shared tracked-data cache after --move writes to avoid a stale-cache window for other scripts
This commit is contained in:
@@ -352,6 +352,16 @@ if [[ "$MOVE_MODE" == true ]]; then
|
||||
fi
|
||||
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 "━━━━━ $ICON_SUMMARY MOVE SUMMARY ━━━━━"
|
||||
echo "$ICON_SUCCESS Moved: $MOVED"
|
||||
|
||||
Reference in New Issue
Block a user