add notification when rate limit reached

This commit is contained in:
Mark Eaton 2019-05-13 14:33:33 -04:00
parent 6b26940ee9
commit 2f1a34852e
1 changed files with 2 additions and 0 deletions

View File

@ -79,6 +79,8 @@ def checkToots(timeline, deleted_count=0):
time.sleep(
2
) # wait 2 secs between deletes to be a bit nicer to the server
if mastodon.ratelimit_remaining == 0:
print("Rate limit reached. Waiting for a rate limit reset...")
if not options.test:
mastodon.status_delete(toot)
except MastodonError as e: