Fix DataOK download reset after COOLDOWN

This commit is contained in:
aperez 2025-12-26 13:38:12 +03:00
parent 02132f1732
commit 561eac8a7e

View File

@ -1113,10 +1113,14 @@ def sync_cross_simulation(auth_manager, download_manager, sync_config, dry_run=F
continue
if download_profile['state'] not in [download_manager.STATE_ACTIVE, download_manager.STATE_LOCKED]:
logger.info(f"Syncing active state: Activating download profile '{target_profile_name}' to match auth requirements.")
is_from_cooldown = download_profile['state'] == download_manager.STATE_COOLDOWN
log_msg_suffix = " (from COOLDOWN)" if is_from_cooldown else ""
logger.info(f"Syncing active state: Activating download profile '{target_profile_name}' to match auth requirements{log_msg_suffix}.")
if not dry_run:
download_manager.update_profile_state(target_profile_name, download_manager.STATE_ACTIVE, "Synced from auth requirements")
download_manager.reset_profile_counters(target_profile_name)
# Only reset counters if it's coming from a long-term rest, not a short cooldown.
if not is_from_cooldown:
download_manager.reset_profile_counters(target_profile_name)
# Deactivate any download profiles that are active but shouldn't be
for dl_profile_name, dl_profile in all_download_profiles.items():