Longer wait to mitigate API error 422

This commit is contained in:
jeancf 2023-06-28 13:53:26 +02:00
parent 9e66475fe0
commit 3732392dbf

View File

@ -1107,9 +1107,9 @@ def main(argv):
except MastodonAPIError: except MastodonAPIError:
# Assuming this is an: # Assuming this is an:
# ERROR ('Mastodon API returned error', 422, 'Unprocessable Entity', 'Cannot attach files that have not finished processing. Try again in a moment!') # ERROR ('Mastodon API returned error', 422, 'Unprocessable Entity', 'Cannot attach files that have not finished processing. Try again in a moment!')
logging.warning('Mastodon API Error 422: Cannot attach files that have not finished processing. Waiting 15 seconds and retrying.') logging.warning('Mastodon API Error 422: Cannot attach files that have not finished processing. Waiting 60 seconds and retrying.')
# Wait 15 seconds # Wait 60 seconds
time.sleep(15) time.sleep(60)
# retry posting # retry posting
try: try:
toot = mastodon.status_post(tweet['tweet_text'], media_ids=media_ids) toot = mastodon.status_post(tweet['tweet_text'], media_ids=media_ids)