From e093887b747acadf967bb9aa8750d2b781da2c8c Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Thu, 15 Dec 2022 19:02:58 +0100 Subject: [PATCH] refactor(sessions): Rename code to util --- backend/capellacollab/sessions/idletimeout.py | 4 ++-- backend/capellacollab/sessions/routes.py | 4 ++-- backend/capellacollab/sessions/{core.py => util.py} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename backend/capellacollab/sessions/{core.py => util.py} (100%) diff --git a/backend/capellacollab/sessions/idletimeout.py b/backend/capellacollab/sessions/idletimeout.py index 7dde35b2f..35ed51880 100644 --- a/backend/capellacollab/sessions/idletimeout.py +++ b/backend/capellacollab/sessions/idletimeout.py @@ -11,7 +11,7 @@ from capellacollab.config import config from capellacollab.core import database -from capellacollab.sessions import core +from capellacollab.sessions import util from capellacollab.sessions.crud import get_session_by_id from capellacollab.sessions.operators import OPERATOR @@ -34,7 +34,7 @@ def terminate_idle_session(): log.info("Terminating idle session %s", session_id) with database.SessionLocal() as db: if session := get_session_by_id(db, session_id): - core.terminate_session(session, db, OPERATOR) + util.terminate_session(session, db, OPERATOR) else: log.error( "Session was not found in our database. Terminating idle session %s", diff --git a/backend/capellacollab/sessions/routes.py b/backend/capellacollab/sessions/routes.py index c1da80818..c5c636ae4 100644 --- a/backend/capellacollab/sessions/routes.py +++ b/backend/capellacollab/sessions/routes.py @@ -63,7 +63,7 @@ from capellacollab.users.injectables import get_own_user from capellacollab.users.models import DatabaseUser, Role -from . import core +from . import util from .injectables import get_existing_session router = APIRouter( @@ -359,7 +359,7 @@ def end_session( db: Session = Depends(get_db), operator: KubernetesOperator = Depends(get_operator), ): - core.terminate_session(db, session, operator) + util.terminate_session(db, session, operator) @router.post( diff --git a/backend/capellacollab/sessions/core.py b/backend/capellacollab/sessions/util.py similarity index 100% rename from backend/capellacollab/sessions/core.py rename to backend/capellacollab/sessions/util.py