mirror of
https://gitlab.com/jeancf/twoot.git
synced 2024-11-23 20:11:11 +00:00
Longer wait to mitigate API error 422
This commit is contained in:
parent
9e66475fe0
commit
3732392dbf
6
twoot.py
6
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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user