Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
Better checked will_finish and is_finished
Browse files Browse the repository at this point in the history
Signed-off-by: Cédric Foellmi <cedric@onekiloparsec.dev>
  • Loading branch information
onekiloparsec committed May 6, 2020
1 parent fa7332e commit 4a06ce8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oort/app/helpers/fileuploader.py
Expand Up @@ -166,10 +166,10 @@ def is_started(self):
return self.started is not None and self.ended is None

def will_finish(self):
return self.is_started() and self.progress / 1000 < 100
return self.is_started() and self.progress >= 95

def is_finished(self):
return self.ended is not None and (datetime.now() - self.ended).total_seconds() > 2
return self.started is not None and self.ended is not None

def to_dict(self):
return {
Expand Down

0 comments on commit 4a06ce8

Please sign in to comment.