diff --git a/bootstrap.py b/bootstrap.py index 2d455e5..6a4dbc8 100644 --- a/bootstrap.py +++ b/bootstrap.py @@ -42,7 +42,7 @@ with open("hub_api/docs/openapi-specs.yml", "r") as stream: "model_filter": lambda tag: True, # all in } ], - "static_url_path": "/flasgger_static", + "static_url_path": "/api/v1.4/static", "specs_route": "/v1.4/api-docs/", "openapi": "3.0.0" } @@ -56,5 +56,5 @@ with open("hub_api/docs/openapi-specs.yml", "r") as stream: def home(): return Response(headers={'Access-Control-Allow-Origin': '*'}) -threading.Thread(target=sh.session_garbage_collector, daemon=True, args="5").start() -app.run(port=15789, host="0.0.0.0", debug=True) \ No newline at end of file +threading.Thread(target=sh.expired_sessions_collector, daemon=True, args="5").start() +app.run(port=15789, host="0.0.0.0", debug=True) diff --git a/hub_api/helpers/session_helper.py b/hub_api/helpers/session_helper.py index cb69ca0..b2a240b 100644 --- a/hub_api/helpers/session_helper.py +++ b/hub_api/helpers/session_helper.py @@ -56,7 +56,7 @@ class SessionData: return usage_catalog -def session_garbage_collector(session_timeout_duration): +def expired_sessions_collector(session_timeout_duration): # loop through all sessions and remove expired sessions while True: if bool(sessions): @@ -65,7 +65,6 @@ def session_garbage_collector(session_timeout_duration): if _expire < datetime.datetime.now(): print("session with session_id: ", session, "expired.") del sessions[session] - time.sleep(60*int(session_timeout_duration)) def _validate_session(session_id, token, application_uuid):