mirror of
https://github.com/clearml/clearml-agent
synced 2025-02-07 13:26:08 +00:00
Fix access to config object
This commit is contained in:
parent
9eee213683
commit
76c533a2e8
@ -1166,7 +1166,7 @@ class Worker(ServiceCommandSection):
|
|||||||
print("No tasks in Queues, sleeping for {:.1f} seconds".format(self._polling_interval))
|
print("No tasks in Queues, sleeping for {:.1f} seconds".format(self._polling_interval))
|
||||||
sleep(self._polling_interval)
|
sleep(self._polling_interval)
|
||||||
|
|
||||||
if self._session.config["agent.reload_config"]:
|
if self._session.config.get("agent.reload_config", False):
|
||||||
self.reload_config()
|
self.reload_config()
|
||||||
finally:
|
finally:
|
||||||
# if we are in dynamic gpus mode, shutdown all active runs
|
# if we are in dynamic gpus mode, shutdown all active runs
|
||||||
@ -1197,7 +1197,7 @@ class Worker(ServiceCommandSection):
|
|||||||
except Exception:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
worker_name = self._session.config["agent.worker_name"] + ':gpu'
|
worker_name = self._session.config.get("agent.worker_name", "") + ':gpu'
|
||||||
our_workers = [
|
our_workers = [
|
||||||
w.id for w in response.workers
|
w.id for w in response.workers
|
||||||
if w.id.startswith(worker_name) and w.id != self.worker_id]
|
if w.id.startswith(worker_name) and w.id != self.worker_id]
|
||||||
@ -1661,7 +1661,9 @@ class Worker(ServiceCommandSection):
|
|||||||
|
|
||||||
# noinspection PyBroadException
|
# noinspection PyBroadException
|
||||||
try:
|
try:
|
||||||
config_data = self._session.config.as_plain_ordered_dict() if config is None else config.as_plain_ordered_dict()
|
config_data = (
|
||||||
|
self._session.config.as_plain_ordered_dict() if config is None else config.as_plain_ordered_dict()
|
||||||
|
)
|
||||||
if clean_api_credentials:
|
if clean_api_credentials:
|
||||||
api = config_data.get("api")
|
api = config_data.get("api")
|
||||||
if api:
|
if api:
|
||||||
|
Loading…
Reference in New Issue
Block a user