Fix DataOK download reset after COOLDOWN
This commit is contained in:
parent
02132f1732
commit
561eac8a7e
@ -1113,9 +1113,13 @@ def sync_cross_simulation(auth_manager, download_manager, sync_config, dry_run=F
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if download_profile['state'] not in [download_manager.STATE_ACTIVE, download_manager.STATE_LOCKED]:
|
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:
|
if not dry_run:
|
||||||
download_manager.update_profile_state(target_profile_name, download_manager.STATE_ACTIVE, "Synced from auth requirements")
|
download_manager.update_profile_state(target_profile_name, download_manager.STATE_ACTIVE, "Synced from auth requirements")
|
||||||
|
# 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)
|
download_manager.reset_profile_counters(target_profile_name)
|
||||||
|
|
||||||
# Deactivate any download profiles that are active but shouldn't be
|
# Deactivate any download profiles that are active but shouldn't be
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user