This commit is contained in:
2025-05-07 14:06:02 +10:00
parent c4e01d3d63
commit 110346064f
+10
View File
@@ -393,6 +393,16 @@ def post_engagement_tweet():
post_counts.append(author_count)
save_post_counts(post_counts)
if author_count["month"] != datetime.now(timezone.utc).strftime("%Y-%m"):
logging.info(f"Resetting monthly count for {username} due to new month")
author_count["month"] = datetime.now(timezone.utc).strftime("%Y-%m")
author_count["monthly_count"] = 0
if author_count["day"] != datetime.now(timezone.utc).strftime("%Y-%m-%d"):
logging.info(f"Resetting daily count for {username} due to new day")
author_count["day"] = datetime.now(timezone.utc).strftime("%Y-%m-%d")
author_count["daily_count"] = 0
if author_count["monthly_count"] >= 500:
logging.warning(f"Monthly post limit (500) reached for {username}, skipping")
continue