From 832093342205e5ab8456f986f7ba8b22049b5b9b Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Wed, 25 Sep 2024 18:37:37 +0300 Subject: [PATCH] add delay between image sends --- bots/tasks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bots/tasks.py b/bots/tasks.py index b7e7581..c4a5d32 100644 --- a/bots/tasks.py +++ b/bots/tasks.py @@ -2,6 +2,7 @@ import json import logging import os import traceback +from time import sleep from telegram import Bot, InlineKeyboardMarkup, InlineKeyboardButton from telegram.error import RetryAfter @@ -38,6 +39,7 @@ def upload_image_rpc(self, queued_image_pk, fpath, caption): qi.processed = True qi.save() os.unlink(fpath) + sleep(.3) except RetryAfter as e: raise self.retry(exc=e, countdown=int(e.retry_after)) except Exception as e: