update real time rate limiting checks for X
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user