Merge pull request #9 from YunoHost/send-sigterm-on-cancel

Send SIGTERM when cancelling jobs ?
This commit is contained in:
Bram 2021-01-02 14:56:52 +01:00 committed by GitHub
commit ee8b73e563
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

1
run.py
View file

@ -440,6 +440,7 @@ async def run_job(worker, job):
}, ["jobs", f"job-{job.id}", f"app-jobs-{job.url_or_path}"])
except CancelledError:
command.terminate()
job.log += "\n"
job.end_time = datetime.now()
job.state = "canceled"