diff options
Diffstat (limited to 'src/services/api/rest/routers.py')
-rw-r--r-- | src/services/api/rest/routers.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/services/api/rest/routers.py b/src/services/api/rest/routers.py index 1568f7d0c..38b10ef7d 100644 --- a/src/services/api/rest/routers.py +++ b/src/services/api/rest/routers.py @@ -682,4 +682,12 @@ def poweroff_op(data: PoweroffModel): def rest_init(app: "FastAPI"): + if all(r in app.routes for r in router.routes): + return app.include_router(router) + + +def rest_clear(app: "FastAPI"): + for r in router.routes: + if r in app.routes: + app.routes.remove(r) |