From b8ab6dded776d0b5f7d67d24e70fdee5f765a597 Mon Sep 17 00:00:00 2001 From: Shane Date: Thu, 15 May 2025 15:49:15 +1000 Subject: [PATCH] try --- foodie_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/foodie_utils.py b/foodie_utils.py index 48643f2..91f881b 100644 --- a/foodie_utils.py +++ b/foodie_utils.py @@ -1764,6 +1764,9 @@ def check_author_rate_limit(author, max_tweets=17, tweet_window_seconds=86400): reset_time = author_info.get('tweet_reset', current_time + tweet_window_seconds) prune_system_activity(reset_time) + # Debug: log is_any_script_running() + logger.debug(f"[DEBUG] is_any_script_running() = {is_any_script_running()}") + # Check if any script is running if is_any_script_running(): # At least one script is running, trust rate_limit_info.json @@ -1786,8 +1789,9 @@ def check_author_rate_limit(author, max_tweets=17, tweet_window_seconds=86400): remaining = remaining - author_info.get('tweets_posted_in_run', 0) else: # No scripts are running, post test tweet to sync quota - logger.info(f"No scripts are running, posting test tweet for {username} to sync quota") + logger.debug(f"[DEBUG] NO scripts running, will call get_x_rate_limit_status for {username}") remaining, api_reset = get_x_rate_limit_status(author) + logger.debug(f"[DEBUG] API returned: remaining={remaining}, api_reset={api_reset} for {username}") if remaining is None or api_reset is None: # Fallback: Use last known quota or assume 0 remaining if current_time < author_info.get('tweet_reset', current_time + tweet_window_seconds):