mirror of
https://github.com/clearml/clearml-agent
synced 2025-02-07 05:19:17 +00:00
Fix runtime property overriding existing properties
This commit is contained in:
parent
6b7ee12dc1
commit
159a6e9a5a
@ -858,10 +858,21 @@ class Worker(ServiceCommandSection):
|
|||||||
|
|
||||||
# noinspection PyBroadException
|
# noinspection PyBroadException
|
||||||
try:
|
try:
|
||||||
|
result = task_session.send_request(
|
||||||
|
service='tasks',
|
||||||
|
action='get_all',
|
||||||
|
version='2.15',
|
||||||
|
method=Request.def_method,
|
||||||
|
json={'id': [task_id], 'only_fields': ["runtime"], 'search_hidden': True}
|
||||||
|
)
|
||||||
|
|
||||||
|
runtime = result.json().get("data", {}).get("tasks", [])[0].get("runtime") or {}
|
||||||
|
runtime[self.hostname_task_runtime_prop] = socket.gethostname()
|
||||||
|
|
||||||
res = task_session.send_request(
|
res = task_session.send_request(
|
||||||
service='tasks', action='edit', method=Request.def_method,
|
service='tasks', action='edit', method=Request.def_method,
|
||||||
json={
|
json={
|
||||||
"task": task_id, "force": True, "runtime": {self.hostname_task_runtime_prop: socket.gethostname()}
|
"task": task_id, "force": True, "runtime": runtime
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if not res.ok:
|
if not res.ok:
|
||||||
|
Loading…
Reference in New Issue
Block a user