Files
we-mp-rss/core/queue
geek_michaelandClaude Opus 4.7 e0bd7fd069 fix: prevent event loop blocking and add queue task timeout
Two related fixes for server unresponsiveness:

1. apis/message_task.py: test_message_task is an async endpoint that
   called web_hook() synchronously. If the webhook request hangs, this
   blocks the entire uvicorn event loop, freezing all HTTP responses.
   Changed to await asyncio.to_thread() so the blocking call runs in a
   thread pool without stalling the event loop.

2. core/queue/queue.py: the queue worker thread executes tasks with no
   timeout. A single hung task blocks all subsequent tasks permanently.
   Wrapped task execution in ThreadPoolExecutor with a 600s timeout,
   so the worker can recover and process remaining tasks.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 21:29:51 +08:00
..
2026-04-02 23:23:25 +08:00