use dynamic delay retry
This commit is contained in:
parent
7961e016eb
commit
49a1b62f21
@ -3,6 +3,8 @@ import logging
|
||||
import os
|
||||
import traceback
|
||||
|
||||
from telegram.error import RetryAfter
|
||||
|
||||
from config.celery import app
|
||||
from djconfig import config
|
||||
|
||||
@ -32,6 +34,8 @@ def upload_image_rpc(self, queued_image_pk, fpath, caption):
|
||||
qi.processed = True
|
||||
qi.save()
|
||||
os.unlink(fpath)
|
||||
except RetryAfter as e:
|
||||
raise self.retry(exc=e, countdown=int(e.retry_after))
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
raise self.retry(exc=e, countdown=5)
|
||||
|
Loading…
Reference in New Issue
Block a user