forked from GithubBackups/healthchecks
Tighten Telegram rate limit to 6 messages / minute
With the previous 10 minutes / minute limit we were still hitting Telegram API rate limit (the 429, "Too Many Requests" response) from time to time. Therefore, tighten the limit a bit on our side.
This commit is contained in:
parent
f607ee67d5
commit
ee37d305ef
@ -899,8 +899,8 @@ class TokenBucket(models.Model):
|
|||||||
def authorize_telegram(telegram_id):
|
def authorize_telegram(telegram_id):
|
||||||
value = "tg-%s" % telegram_id
|
value = "tg-%s" % telegram_id
|
||||||
|
|
||||||
# 10 messages for a single chat per minute:
|
# 6 messages for a single chat per minute:
|
||||||
return TokenBucket.authorize(value, 10, 60)
|
return TokenBucket.authorize(value, 6, 60)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def authorize_sudo_code(user):
|
def authorize_sudo_code(user):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user