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:
Pēteris Caune 2021-01-11 10:54:46 +02:00
parent f607ee67d5
commit ee37d305ef
No known key found for this signature in database
GPG Key ID: E28D7679E9A9EDE2

View File

@ -899,8 +899,8 @@ class TokenBucket(models.Model):
def authorize_telegram(telegram_id):
value = "tg-%s" % telegram_id
# 10 messages for a single chat per minute:
return TokenBucket.authorize(value, 10, 60)
# 6 messages for a single chat per minute:
return TokenBucket.authorize(value, 6, 60)
@staticmethod
def authorize_sudo_code(user):