mirror of
https://github.com/YunoHost/yunorunner.git
synced 2024-09-03 20:05:52 +02:00
[enh] add information about job error in log
This commit is contained in:
parent
97a4d2c443
commit
d6c52ce2e4
1 changed files with 4 additions and 0 deletions
4
run.py
4
run.py
|
@ -342,6 +342,10 @@ async def run_job(worker, job):
|
|||
traceback.print_exc()
|
||||
task_logger.exception(f"ERROR in job '{job.name} #{job.id}'")
|
||||
|
||||
job.log += "\n"
|
||||
job.log += "Job error on:\n"
|
||||
job.log += traceback.format_exc()
|
||||
|
||||
job.end_time = datetime.now()
|
||||
job.state = "error"
|
||||
job.save()
|
||||
|
|
Loading…
Add table
Reference in a new issue