mirror of
https://github.com/simon987/task_tracker_drone.git
synced 2025-04-10 14:06:46 +00:00
Debugging messages
This commit is contained in:
parent
5c03c7a942
commit
2e3758be6d
@ -3,6 +3,7 @@ import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import time
|
||||
import traceback
|
||||
from subprocess import Popen
|
||||
|
||||
@ -48,6 +49,7 @@ class WorkerContext:
|
||||
return self._format_project_path(project)
|
||||
|
||||
def execute_task(self, task: Task):
|
||||
start_time = time.time()
|
||||
path = self._get_project_path(task.project)
|
||||
|
||||
if os.path.exists(os.path.join(path, "run")):
|
||||
@ -57,14 +59,14 @@ class WorkerContext:
|
||||
try:
|
||||
json_result = json.loads(result)
|
||||
self._do_post_task_hooks(json_result)
|
||||
end_time = time.time()
|
||||
print(self._worker.release_task(task.id,
|
||||
json_result["result"],
|
||||
json_result[
|
||||
"verification"] if "verification" in json_result else 0).text
|
||||
+ "for result" + result)
|
||||
+ " in " + str(end_time - start_time) + "ms")
|
||||
except Exception as e:
|
||||
print(str(e) + traceback.format_exc())
|
||||
return
|
||||
else:
|
||||
print(path + "/run doesn't exist!")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user