MCPcopy Index your code
hub / github.com/vastsa/FileCodeBox / refresh_settings_middleware

Function refresh_settings_middleware

main.py:730–744  ·  view source on GitHub ↗
(request, call_next)

Source from the content-addressed store, hash-verified

728
729@app.middleware("http")
730async def refresh_settings_middleware(request, call_next):
731 await refresh_settings()
732 if not is_runtime_initialized() and not is_setup_path(request.url.path):
733 if wants_html_response(request):
734 return setup_response(build_setup_page())
735 return JSONResponse(
736 status_code=428,
737 content={
738 "code": 428,
739 "message": "系统未初始化,请先完成初始化",
740 "msg": "系统未初始化,请先完成初始化",
741 "detail": {"setup": "/setup"},
742 },
743 )
744 return await call_next(request)
745
746app.add_middleware(
747 CORSMiddleware,

Callers

nothing calls this directly

Calls 6

refresh_settingsFunction · 0.90
is_runtime_initializedFunction · 0.90
is_setup_pathFunction · 0.85
wants_html_responseFunction · 0.85
setup_responseFunction · 0.85
build_setup_pageFunction · 0.85

Tested by

no test coverage detected