From ee37d305ef2025b2e6eab451ad4f3df4baf434e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Mon, 11 Jan 2021 10:54:46 +0200 Subject: [PATCH] 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. --- hc/api/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hc/api/models.py b/hc/api/models.py index 6c1f202a..8bdd91ad 100644 --- a/hc/api/models.py +++ b/hc/api/models.py @@ -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):