fix: revert onstartup extension route init

This commit is contained in:
Vlad Stan 2023-01-18 16:32:04 +02:00
parent 1d2e994862
commit 98735d79c7

View File

@ -160,16 +160,14 @@ def register_routes(app: FastAPI) -> None:
app.include_router(core_app)
app.include_router(core_html_routes)
@app.on_event("startup")
def register_all_ext_routes():
for ext in get_valid_extensions():
try:
register_ext_routes(app, ext)
except Exception as e:
logger.error(str(e))
raise ImportError(
f"Please make sure that the extension `{ext.code}` follows conventions."
)
for ext in get_valid_extensions():
try:
register_ext_routes(app, ext)
except Exception as e:
logger.error(str(e))
raise ImportError(
f"Please make sure that the extension `{ext.code}` follows conventions."
)
def register_new_ext_routes(app: FastAPI) -> Callable: