mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-19 10:51:34 +08:00
Merge pull request #11074 from mvdbeek/fastapi_app_tweak
Build FastAPI app in a single location
This commit is contained in:
@@ -30,9 +30,8 @@ def add_exception_handler(
|
||||
)
|
||||
|
||||
|
||||
def initialize_fast_app(gx_app, app=None):
|
||||
if app is None:
|
||||
app = FastAPI()
|
||||
def initialize_fast_app(gx_app):
|
||||
app = FastAPI()
|
||||
|
||||
add_exception_handler(app)
|
||||
wsgi_handler = WSGIMiddleware(gx_app)
|
||||
|
||||
+1
-5
@@ -1,5 +1,4 @@
|
||||
import uvicorn
|
||||
from fastapi import FastAPI
|
||||
from galaxy_main import (
|
||||
GalaxyConfigBuilder,
|
||||
main,
|
||||
@@ -9,16 +8,13 @@ from galaxy.util.properties import load_app_properties
|
||||
from galaxy.webapps.galaxy.buildapp import app_factory
|
||||
from galaxy.webapps.galaxy.fast_app import initialize_fast_app
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
def wsgiloop(args, log):
|
||||
config_builder = GalaxyConfigBuilder(args)
|
||||
kwds = config_builder.app_kwds()
|
||||
kwds = load_app_properties(**kwds)
|
||||
gx = app_factory(global_conf=config_builder.global_conf(), **kwds)
|
||||
initialize_fast_app(gx, app=app)
|
||||
uvicorn.run(app)
|
||||
uvicorn.run(initialize_fast_app(gx))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user