Skip to content

Commit 92dcdc8

Browse files
author
maebahesioru
committed
fix: restore queue_worker export in server.py, fix RESPONSE_COMPLETION_TIMEOUT import
1 parent 8070737 commit 92dcdc8

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/api/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ async def _shutdown_resources():
158158
async def lifespan(app: FastAPI):
159159
"""FastAPI application life cycle management"""
160160
import server
161-
from server import queue_worker
161+
from api import queue_worker
162162
original_streams = (sys.stdout, sys.stderr)
163163
initial_stdout, initial_stderr = _setup_logging()
164164
logger = server.logger

src/api/queue_worker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,11 @@ async def non_streaming_disconnect_monitor():
205205

206206
try:
207207
if completion_event:
208-
from server import RESPONSE_COMPLETION_TIMEOUT
208+
from config import RESPONSE_COMPLETION_TIMEOUT
209209
await asyncio.wait_for(completion_event.wait(), timeout=RESPONSE_COMPLETION_TIMEOUT / 1000 + 60)
210210
logger.info(f'[{req_id}] (Worker) ✅ 流式生成器完成信号收到。客户端提前断开: {client_disconnected_early}')
211211
else:
212-
from server import RESPONSE_COMPLETION_TIMEOUT
212+
from config import RESPONSE_COMPLETION_TIMEOUT
213213
await asyncio.wait_for(asyncio.shield(result_future), timeout=RESPONSE_COMPLETION_TIMEOUT / 1000 + 60)
214214
logger.info(f'[{req_id}] (Worker) ✅ 非流式处理完成。客户端提前断开: {client_disconnected_early}')
215215

src/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from playwright.async_api import Page as AsyncPage, Browser as AsyncBrowser, Playwright as AsyncPlaywright
1212
from config import *
1313
from models import WebSocketConnectionManager
14-
from api import create_app
14+
from api import create_app, queue_worker
1515

1616
STREAM_QUEUE: Optional[multiprocessing.Queue] = None
1717
STREAM_PROCESS = None

0 commit comments

Comments
 (0)