fix creating dud progress entries
When the import process finishes it can set progress to 100 multiple times. The first call would add a stop time to the running progress, but each further call with progress=100 would create another entry in the table with stop already set.
This commit is contained in:
parent
57cfd8f496
commit
e939e57a8f
1 changed files with 6 additions and 0 deletions
|
|
@ -136,6 +136,12 @@ async def set_import_progress(progress: float) -> Progress:
|
|||
progress = min(max(0.0, progress), 100.0) # clamp to 0 <= progress <= 100
|
||||
|
||||
current = await get_import_progress()
|
||||
is_stopped = current and current.stopped is not None
|
||||
|
||||
if progress == 100.0 and is_stopped:
|
||||
assert current
|
||||
return current
|
||||
|
||||
is_update = current and current.stopped is None
|
||||
|
||||
if not current or not is_update:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue