mirror of
https://github.com/YunoHost/yunorunner.git
synced 2024-09-03 20:05:52 +02:00
[mod] when canceling a job, set its end time
This commit is contained in:
parent
e4fc3c08dc
commit
a55bf386eb
1 changed files with 1 additions and 0 deletions
1
run.py
1
run.py
|
@ -542,6 +542,7 @@ async def api_stop_job(request, job_id):
|
|||
if job.state == "running":
|
||||
api_logger.info(f"Cancel running job '{job.name}' [job.id] on request")
|
||||
job.state = "canceled"
|
||||
job.end_time = datetime.now()
|
||||
job.save()
|
||||
|
||||
jobs_in_memory_state[job.id]["task"].cancel()
|
||||
|
|
Loading…
Add table
Reference in a new issue