|
|
@@ -1,4 +1,3 @@
|
|
|
-import subprocess
|
|
|
from fastapi import APIRouter, HTTPException, Request, Depends
|
|
|
from fastapi.responses import JSONResponse, StreamingResponse
|
|
|
import httpx
|
|
|
@@ -122,7 +121,6 @@ async def status() -> ResponseStatus:
|
|
|
celery_status["workers"]["data"]
|
|
|
)
|
|
|
|
|
|
- logger.info(f"Filtered celery_status: {celery_status}")
|
|
|
return ResponseStatus(
|
|
|
endpoint=Endpoint(health=health),
|
|
|
browser_config=config.browser,
|
|
|
@@ -132,6 +130,7 @@ async def status() -> ResponseStatus:
|
|
|
class StartupRequest(BaseModel):
|
|
|
worker_name: str
|
|
|
action: str
|
|
|
+ select_proxy: Optional[str] = ''
|
|
|
data: Optional[Dict] = {}
|
|
|
|
|
|
@router.post("/ctrl", tags=["worker"])
|
|
|
@@ -145,7 +144,7 @@ async def start_worker(request: StartupRequest):
|
|
|
logger.info(f"clean {request.data}")
|
|
|
else:
|
|
|
raise HTTPException(status_code=400, detail=f"Invalid action: {request.action}")
|
|
|
- logger.info(f"{request.action} {request.worker_name}")
|
|
|
+ logger.info(f"{request}")
|
|
|
flower_workers = await celery_worker.check_worker_status()
|
|
|
|
|
|
# 保持数据转换的一致性
|