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