From 045dfcd84226a4a0771e563a1cb6873fcc80ecfa Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 15 May 2024 17:00:04 +0200 Subject: [server] Remove user session when creating cow session --- .../main/java/org/openslx/bwlp/sat/fileserv/cow/CowSessionManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/cow/CowSessionManager.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/cow/CowSessionManager.java index 197341fe..8413c04d 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/cow/CowSessionManager.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/cow/CowSessionManager.java @@ -51,7 +51,7 @@ public class CowSessionManager { } } - public static boolean add(String id, CowSession session) { + private static boolean add(String id, CowSession session) { Lock lock = SESSION_LOCK.writeLock(); lock.lock(); try { @@ -72,6 +72,7 @@ public class CowSessionManager { UserInfo user = SessionManager.get(cowid); if (user == null) throw new RuntimeException("Unknown user"); + SessionManager.remove(cowid); // String sessionId = UUID.randomUUID().toString(); CowSession session = new CowSession(ld.imagePath, ld.configuration, ld.imageBaseId, ld.vmName, ld.restricted, user, sessionType); -- cgit v1.2.3-55-g7522