Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb committed Jul 4, 2024
1 parent e21fac7 commit 7a64ced
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/anemoi/registry/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def run(self):
def choose_task(self):
request = self.request.copy()
request["destination"] = request.get("destination", self.destination)
request["action"] = "transfer-dataset"

# if a task is queued, take it
for entry in TaskCatalogueEntryList(status="queued", **request):
Expand All @@ -87,9 +88,9 @@ def choose_task(self):
# else if a task is running, check if it has been running for too long, and free it
cat = TaskCatalogueEntryList(status="running", **request)
if not cat:
LOG.info(cat.to_str(long=True))
else:
LOG.info("No queued tasks found")
else:
LOG.info(cat.to_str(long=True))
for entry in cat:
updated = datetime.datetime.fromisoformat(entry.record["updated"])
LOG.info(f"Task {entry.key} is already running, last update {when(updated, use_utc=True)}.")
Expand Down

0 comments on commit 7a64ced

Please sign in to comment.