mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 12:20:38 +08:00
Refactor GitLab webhook initialization to move app setup outside of start function
This commit is contained in:
@ -133,15 +133,16 @@ def handle_ask_line(body, data):
|
|||||||
async def root():
|
async def root():
|
||||||
return {"status": "ok"}
|
return {"status": "ok"}
|
||||||
|
|
||||||
def start():
|
gitlab_url = get_settings().get("GITLAB.URL", None)
|
||||||
gitlab_url = get_settings().get("GITLAB.URL", None)
|
if not gitlab_url:
|
||||||
if not gitlab_url:
|
raise ValueError("GITLAB.URL is not set")
|
||||||
raise ValueError("GITLAB.URL is not set")
|
get_settings().config.git_provider = "gitlab"
|
||||||
get_settings().config.git_provider = "gitlab"
|
middleware = [Middleware(RawContextMiddleware)]
|
||||||
middleware = [Middleware(RawContextMiddleware)]
|
app = FastAPI(middleware=middleware)
|
||||||
app = FastAPI(middleware=middleware)
|
app.include_router(router)
|
||||||
app.include_router(router)
|
|
||||||
|
|
||||||
|
|
||||||
|
def start():
|
||||||
uvicorn.run(app, host="0.0.0.0", port=3000)
|
uvicorn.run(app, host="0.0.0.0", port=3000)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user