mastodon: stop before hitting the rate limit
This commit is contained in:
parent
689c013f55
commit
a68a673925
|
@ -87,6 +87,8 @@ def get_api_for_acc(account):
|
||||||
# https://github.com/tootsuite/mastodon/issues/4637
|
# https://github.com/tootsuite/mastodon/issues/4637
|
||||||
# so we have to do this:
|
# so we have to do this:
|
||||||
api.timeline()
|
api.timeline()
|
||||||
|
if api.ratelimit_remaining / api.ratelimit_limit < 1/4:
|
||||||
|
raise TemporaryError("Rate limit too low")
|
||||||
return api
|
return api
|
||||||
except MastodonUnauthorizedError as e:
|
except MastodonUnauthorizedError as e:
|
||||||
if sentry:
|
if sentry:
|
||||||
|
|
Loading…
Reference in New Issue