summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2024-05-15 17:00:04 +0200
committerSimon Rettberg2024-05-15 17:00:04 +0200
commit045dfcd84226a4a0771e563a1cb6873fcc80ecfa (patch)
tree7dc11fdeec2f83e5ed398a2cc14969d936640724
parent[server] cow: Fix copying virtId (diff)
downloadtutor-module-045dfcd84226a4a0771e563a1cb6873fcc80ecfa.tar.gz
tutor-module-045dfcd84226a4a0771e563a1cb6873fcc80ecfa.tar.xz
tutor-module-045dfcd84226a4a0771e563a1cb6873fcc80ecfa.zip
[server] Remove user session when creating cow session
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/cow/CowSessionManager.java3
1 files changed, 2 insertions, 1 deletions
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);