history: add support for cancelled state

Signed-off-by: Kamil Trzcinski <ayufan@ayufan.eu>
This commit is contained in:
Kamil Trzcinski 2021-06-08 18:15:31 +00:00 committed by Eric Callahan
parent 33cb18517a
commit 6770a965a6
1 changed files with 5 additions and 1 deletions

View File

@ -188,7 +188,11 @@ class History:
elif self.current_job is not None:
if new_state == "complete":
self.finish_job("completed", new_ps)
if new_state == "standby":
elif new_state == "cancelled":
self.finish_job("cancelled", new_ps)
elif new_state == "standby":
# Backward compatibility with
# `CLEAR_PAUSE/SDCARD_RESET_FILE` workflow
self.finish_job("cancelled", self.print_stats)
elif new_state == "error":
self.finish_job("error", new_ps)