Skip to content

Commit

Permalink
fix unfinished transaction finish
Browse files Browse the repository at this point in the history
  • Loading branch information
thoniTUB committed Dec 17, 2024
1 parent 067bb73 commit 9dd290e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions backend/src/main/java/com/bakdata/conquery/util/AuthUtil.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.bakdata.conquery.util;

import java.util.stream.Stream;

import com.bakdata.conquery.io.storage.MetaStorage;
import com.bakdata.conquery.models.auth.entities.Group;
import com.bakdata.conquery.models.auth.entities.User;
Expand Down Expand Up @@ -43,11 +45,13 @@ public synchronized void cleanUpUserAndBelongings(User user, MetaStorage storage

log.debug("Removed {} form configs and {} executions for user '{}'", countForms, countExecs, user);

for (Group group : storage.getAllGroups().toList()) {
if (group.containsMember(user)) {
group.removeMember(user.getId());
group.updateStorage();
log.debug("Removed user '{}' from group '{}'", user.getId(), group.getId());
try(Stream<Group> allGroups = storage.getAllGroups()) {
for (Group group : allGroups.toList()) {
if (group.containsMember(user)) {
group.removeMember(user.getId());
group.updateStorage();
log.debug("Removed user '{}' from group '{}'", user.getId(), group.getId());
}
}
}

Expand Down

0 comments on commit 9dd290e

Please sign in to comment.