mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-12 02:45:18 +00:00
Refactor GitLab webhook initialization to move app setup outside of start function
This commit is contained in:
parent
413547f404
commit
76ff49d446
1 changed files with 9 additions and 8 deletions
|
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue