mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-18 00:19:15 +00:00
refactor(jobs):track 100-on-finished as a progress update
This commit is contained in:
parent
e8c59f5068
commit
d664fcbdc4
|
@ -198,12 +198,15 @@ class Jobs:
|
|||
job.description = description
|
||||
if status_text is not None:
|
||||
job.status_text = status_text
|
||||
if status == JobStatus.FINISHED:
|
||||
job.progress = 100
|
||||
if progress is not None:
|
||||
# explicitly provided progress has priority
|
||||
|
||||
# if it is finished it is 100
|
||||
# unless user says otherwise
|
||||
if status == JobStatus.FINISHED and progress is None:
|
||||
progress = 100
|
||||
if progress is not None and job.progress != progress:
|
||||
job.progress = progress
|
||||
Jobs.log_progress_update(job, progress)
|
||||
|
||||
job.status = status
|
||||
Jobs.log_status_update(job, status)
|
||||
job.updated_at = datetime.datetime.now()
|
||||
|
|
Loading…
Reference in a new issue