Skip to content

Commit

Permalink
Avoid caching on edit timeout (UsergeTeam#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harsh-br0 authored Nov 27, 2022
1 parent c485f69 commit 4404c84
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions userge/utils/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import time
from math import floor
from typing import Dict, Tuple
from typing import Dict, Tuple, Optional

from pyrogram.errors.exceptions import FloodWait

Expand All @@ -26,10 +26,11 @@ async def progress(current: int,
message: 'userge.Message',
ud_type: str,
file_name: str = '',
delay: int = config.Dynamic.EDIT_SLEEP_TIMEOUT) -> None:
delay: Optional[int] = None) -> None:
""" progress function """
if message.process_is_canceled:
await message.client.stop_transmission()
delay = delay or config.Dynamic.EDIT_SLEEP_TIMEOUT
task_id = f"{message.chat.id}.{message.id}"
if current == total:
if task_id not in _TASKS:
Expand Down

0 comments on commit 4404c84

Please sign in to comment.