Wait 15 seconds + Clean up

This commit is contained in:
jeancf 2023-02-06 21:40:18 +01:00
parent faedf27a37
commit a11a6cba65

View File

@ -981,11 +981,6 @@ def main(argv):
# Post toot # Post toot
toot = {} toot = {}
try: try:
# mastodon = Mastodon(
# access_token=TOML['config']['mastodon_user'] + '.secret',
# api_base_url='https://' + TOML['config']['mastodon_instance']
# )
if len(media_ids) == 0: if len(media_ids) == 0:
toot = mastodon.status_post(tweet['tweet_text']) toot = mastodon.status_post(tweet['tweet_text'])
else: else:
@ -995,7 +990,7 @@ def main(argv):
# 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 15 seconds and retrying.')
# Wait 10 seconds # Wait 15 seconds
time.sleep(15) time.sleep(15)
# retry posting # retry posting
try: try: