mirror of
https://github.com/clearml/clearml-server
synced 2025-06-26 23:15:47 +00:00
Fix loading expired worker entries from Redis
This commit is contained in:
parent
36b9ab0453
commit
f7e833bf6f
@ -365,10 +365,15 @@ class WorkerBLL:
|
|||||||
self, company: str, user: str = "*", worker_id: str = "*"
|
self, company: str, user: str = "*", worker_id: str = "*"
|
||||||
) -> Sequence[WorkerEntry]:
|
) -> Sequence[WorkerEntry]:
|
||||||
"""Get worker entries matching the company and user, worker patterns"""
|
"""Get worker entries matching the company and user, worker patterns"""
|
||||||
|
entries = []
|
||||||
match = self._get_worker_key(company, user, worker_id)
|
match = self._get_worker_key(company, user, worker_id)
|
||||||
with TimingContext("redis", "workers_get_all"):
|
with TimingContext("redis", "workers_get_all"):
|
||||||
res = self.redis.scan_iter(match)
|
for r in self.redis.scan_iter(match):
|
||||||
return [WorkerEntry.from_json(self.redis.get(r)) for r in res]
|
data = self.redis.get(r)
|
||||||
|
if data:
|
||||||
|
entries.append(WorkerEntry.from_json(data))
|
||||||
|
|
||||||
|
return entries
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_es_index_suffix():
|
def _get_es_index_suffix():
|
||||||
|
Loading…
Reference in New Issue
Block a user