Skip to content

Commit

Permalink
try to fix, zero division error
Browse files Browse the repository at this point in the history
  • Loading branch information
SpEcHiDe authored Sep 13, 2020
1 parent c483344 commit 449bbee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tobrot/helper_funcs/display_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ async def progress_for_pyrogram(
# if round(current / total * 100, 0) % 5 == 0:
percentage = current * 100 / total
elapsed_time = round(diff)
if elapsed_time == 0:
return
speed = current / elapsed_time
time_to_completion = round((total - current) / speed)
estimated_total_time = elapsed_time + time_to_completion
Expand Down

0 comments on commit 449bbee

Please sign in to comment.