From 7b07cf2c7b961bab4c3a1247c2018bf609d5b637 Mon Sep 17 00:00:00 2001 From: balki <3070606-balki@users.noreply.gitlab.com> Date: Sun, 12 Jun 2022 18:17:05 -0400 Subject: [PATCH] update limiter buffer --- telegram/telegram.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telegram/telegram.go b/telegram/telegram.go index 256e7b0..41fa335 100644 --- a/telegram/telegram.go +++ b/telegram/telegram.go @@ -71,9 +71,9 @@ func NewTelegramSender(transport http.RoundTripper, authToken string) TelegramSe client: &http.Client{Transport: transport}, authToken: authToken, // 20 requests per min with some buffer - rateLimiterPerMin: limiter.NewLimiter(65*time.Second, 20), + rateLimiterPerMin: limiter.NewLimiter((60+15)*time.Second, 20), // 1 msg per sec with some buffer - rateLimiterPerSec: limiter.NewLimiter(1050*time.Millisecond, 1), + rateLimiterPerSec: limiter.NewLimiter(1100*time.Millisecond, 1), } }