diff --git a/orchestration.py b/orchestration.py index 37c75cf..57c3f21 100644 --- a/orchestration.py +++ b/orchestration.py @@ -35,6 +35,6 @@ async def startup(request): @ps.routes.get("/ready") async def ready(request): current_queue = ps.prompt_queue.get_current_queue() - if len(ps[0]) == 0 and len(ps[1]) == 0: + if len(current_queue[0]) == 0 and len(current_queue[1]) == 0: return web.json_response(current_queue) return web.json_response(current_queue, status=503) diff --git a/workflowcheckpointing.py b/workflowcheckpointing.py index ea7c0aa..ced5738 100644 --- a/workflowcheckpointing.py +++ b/workflowcheckpointing.py @@ -136,6 +136,7 @@ class FetchQueue: with self.lock: if item in self.consumed: #TODO: Also update in queue + #TODO: if complete check etag? self.consumed[item][1] = min(self.consumed[item][1], priority) return self.consumed[item][0] for i in range(len(self.queue)): @@ -209,6 +210,7 @@ async def prepare_file(url, path, priority): hashloc = await fetch_loop.enqueue(url, priority) if os.path.exists(path): os.remove(path) + os.makedirs(os.path.split(path)[0], exist_ok=True) #TODO consider if symlinking would be better os.link(hashloc, path)