update real time rate limiting checks for X

This commit is contained in:
2025-05-08 16:27:10 +10:00
parent 01bab56eb6
commit 447bfb0087
7 changed files with 284 additions and 195 deletions
+10 -4
View File
@@ -292,6 +292,16 @@ def curate_from_reddit(posted_titles_data, posted_titles, used_images_data, used
attempts += 1
continue
# Check author availability before GPT calls
author = get_next_author_round_robin()
if not author:
logging.info(f"Skipping post '{title}' due to tweet rate limits for all authors")
attempts += 1
continue
author_username = author["username"]
logging.info(f"Selected author via round-robin: {author_username}")
logging.info(f"Trying Reddit Post: {title} from {source_name}")
try:
@@ -339,10 +349,6 @@ def curate_from_reddit(posted_titles_data, posted_titles, used_images_data, used
final_summary = insert_link_naturally(final_summary, source_name, link)
author = get_next_author_round_robin()
author_username = author["username"]
logging.info(f"Selected author via round-robin: {author_username}")
post_data = {
"title": generate_title_from_summary(final_summary),
"content": final_summary,