From 3732392dbf00aee13189f0428ab7ae825c0f98dc Mon Sep 17 00:00:00 2001 From: jeancf Date: Wed, 28 Jun 2023 13:53:26 +0200 Subject: [PATCH] Longer wait to mitigate API error 422 --- twoot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/twoot.py b/twoot.py index 1ae4d3c..40c56bf 100755 --- a/twoot.py +++ b/twoot.py @@ -1107,9 +1107,9 @@ def main(argv): except MastodonAPIError: # 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!') - logging.warning('Mastodon API Error 422: Cannot attach files that have not finished processing. Waiting 15 seconds and retrying.') - # Wait 15 seconds - time.sleep(15) + logging.warning('Mastodon API Error 422: Cannot attach files that have not finished processing. Waiting 60 seconds and retrying.') + # Wait 60 seconds + time.sleep(60) # retry posting try: toot = mastodon.status_post(tweet['tweet_text'], media_ids=media_ids)