SysOps: manual — 2026-07-30 09:33 UTC
This commit is contained in:
@@ -276,6 +276,39 @@ async def api_tenders(country: Optional[str] = None, status: Optional[str] = "op
|
||||
return await _proxy("GET", "/tenders", params=params)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@router.get("/api/export-intel/settings")
|
||||
async def api_export_intel_settings_get():
|
||||
return await _proxy("GET", "/settings")
|
||||
|
||||
|
||||
@router.put("/api/export-intel/settings")
|
||||
async def api_export_intel_settings_put(request: Request):
|
||||
body = await request.json()
|
||||
async with httpx.AsyncClient(timeout=30.0) as client:
|
||||
r = await client.put(f"{TOOLS}/export-intel/settings", json=body)
|
||||
return r.json()
|
||||
|
||||
|
||||
@router.post("/api/export-intel/sync/places")
|
||||
async def api_sync_places(request: Request):
|
||||
body = {}
|
||||
if request.headers.get("content-type", "").startswith("application/json"):
|
||||
try:
|
||||
body = await request.json()
|
||||
except Exception:
|
||||
body = {}
|
||||
async with httpx.AsyncClient(timeout=7200.0) as client:
|
||||
r = await client.post(f"{TOOLS}/export-intel/sync/places", json=body)
|
||||
return r.json()
|
||||
|
||||
|
||||
@router.get("/api/export-intel/sync/status")
|
||||
async def api_sync_status():
|
||||
return await _proxy("GET", "/sync/status")
|
||||
|
||||
@router.post("/api/export-intel/sync/{kind}")
|
||||
async def api_sync(kind: str, request: Request):
|
||||
body = {}
|
||||
@@ -284,7 +317,7 @@ async def api_sync(kind: str, request: Request):
|
||||
body = await request.json()
|
||||
except Exception:
|
||||
body = {}
|
||||
if kind not in ("contacts", "caterers", "distributors", "customers", "tenders", "all", "world", "region"):
|
||||
if kind not in ("contacts", "caterers", "distributors", "customers", "tenders", "all", "world", "region", "missing", "places"):
|
||||
return {"error": "unknown sync kind"}
|
||||
timeout = 7200.0 if kind in ("world", "region", "all") else 600.0
|
||||
async with httpx.AsyncClient(timeout=timeout) as client:
|
||||
|
||||
Reference in New Issue
Block a user