From 540a59ab53fe0e22cffbbeafcfc23b3e6097b3b0 Mon Sep 17 00:00:00 2001 From: Michal Babinski Date: Wed, 7 Feb 2024 08:32:33 -0800 Subject: [PATCH 1/2] up limit for max pages on list_jobs --- nmdc_automation/api/nmdcapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmdc_automation/api/nmdcapi.py b/nmdc_automation/api/nmdcapi.py index 15e7a5e4..15948b93 100755 --- a/nmdc_automation/api/nmdcapi.py +++ b/nmdc_automation/api/nmdcapi.py @@ -206,7 +206,7 @@ def bump_time(self, obj): return resp.json() @refresh_token - def list_jobs(self, filt=None, max=20): + def list_jobs(self, filt=None, max=100): url = "%sjobs?max_page_size=%s" % (self._base_url, max) d = {} if filt: From d4b9109b72efa34bf53a109d4affb1c6c3b5d9d6 Mon Sep 17 00:00:00 2001 From: Michal Babinski Date: Wed, 7 Feb 2024 08:32:55 -0800 Subject: [PATCH 2/2] fixed filter for unclaimed jobs --- nmdc_automation/workflow_automation/watch_nmdc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nmdc_automation/workflow_automation/watch_nmdc.py b/nmdc_automation/workflow_automation/watch_nmdc.py index 98797918..1f950dee 100644 --- a/nmdc_automation/workflow_automation/watch_nmdc.py +++ b/nmdc_automation/workflow_automation/watch_nmdc.py @@ -117,7 +117,10 @@ def refresh_remote_jobs(self): """ Return a filtered list of nmdc jobs. """ - filt = {"workflow.id": {"$in": self._ALLOWED}} + filt = { + "workflow.id": {"$in": self._ALLOWED}, + "claims": {"$size": 0} + } logging.debug("Looking for jobs") jobs = self.runtime_api.list_jobs(filt=filt) logging.debug(f"Found {len(jobs)} jobs")