From 561eac8a7e71a54519b4b18806d326ae37c366fb Mon Sep 17 00:00:00 2001 From: aperez Date: Fri, 26 Dec 2025 13:38:12 +0300 Subject: [PATCH] Fix DataOK download reset after COOLDOWN --- ytops_client-source/ytops_client/policy_enforcer_tool.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ytops_client-source/ytops_client/policy_enforcer_tool.py b/ytops_client-source/ytops_client/policy_enforcer_tool.py index 0e22a15..8abbe8e 100644 --- a/ytops_client-source/ytops_client/policy_enforcer_tool.py +++ b/ytops_client-source/ytops_client/policy_enforcer_tool.py @@ -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():