Add debug logging to queue manager

parent be00cb97
......@@ -128,21 +128,23 @@ class QueueManager:
def _process_queue(self) -> None:
"""Background thread to process queued jobs."""
print("Queue manager started", flush=True)
while self.running:
try:
with self.lock:
if self.active_jobs < self.max_concurrent:
pending = get_pending_queue_items()
if pending:
print(f"Found {len(pending)} pending job(s)", flush=True)
job = pending[0] # Get highest priority job
if self._can_start_job(job):
self._start_job(job)
else:
print(f"Job {job['id']} waiting for available workers")
print(f"Job {job['id']} waiting for available workers", flush=True)
time.sleep(1) # Check every second
except Exception as e:
print(f"Queue processing error: {e}")
print(f"Queue processing error: {e}", flush=True)
time.sleep(5)
def _start_job(self, job: Dict[str, Any]) -> None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment