Check if a work item has been completed locally by seeing if output_{work_hash}.jsonl is present in the results directory. Args: work_hash: Hash of the work item to check
(self, work_hash: str)
| 278 | return self._queue.qsize() |
| 279 | |
| 280 | async def is_completed(self, work_hash: str) -> bool: |
| 281 | """ |
| 282 | Check if a work item has been completed locally by seeing if |
| 283 | output_{work_hash}.jsonl is present in the results directory. |
| 284 | |
| 285 | Args: |
| 286 | work_hash: Hash of the work item to check |
| 287 | """ |
| 288 | output_file = os.path.join(self._results_dir, f"output_{work_hash}.jsonl") |
| 289 | return os.path.exists(output_file) |
| 290 | |
| 291 | async def get_work(self, worker_lock_timeout_secs: int = 1800) -> Optional[WorkItem]: |
| 292 | """ |