fix(worker): align redis key and fix async task dispatch

- Change blpop key from 'task_queue' to 'tasks'
- Pass coroutine object directly to dispatcher to prevent silent await failure
This commit is contained in:
Luciabrightcode 2025-12-23 15:26:19 +08:00
parent fcc4d44a55
commit 3ddef37f7d

View file

@ -30,7 +30,7 @@ class TaskWorker:
try:
# Blocking pop from task queue
# task format: {"type": "auth|extract", "url": "...", "session_id": "..."}
task_data = await self.redis.blpop("task_queue", timeout=5)
task_data = await self.redis.blpop("tasks", timeout=5)
if not task_data:
continue
@ -40,7 +40,7 @@ class TaskWorker:
# Apply entropy scheduling (variable delay)
await self.scheduler.dispatch_with_entropy(
lambda: self.process_task(task)
self.process_task(task)
)
except Exception as e: