fix: remove extra log on recalculateMatch
This commit is contained in:
parent
6d6324e1b4
commit
bc4dbb532f
@ -292,30 +292,24 @@ public class RMatch {
|
|||||||
if (!o.getCompet().getUuid().equals(connection.pathParam("uuid")))
|
if (!o.getCompet().getUuid().equals(connection.pathParam("uuid")))
|
||||||
throw new DForbiddenException("Permission denied");
|
throw new DForbiddenException("Permission denied");
|
||||||
}))
|
}))
|
||||||
.invoke(m -> System.out.println("A00"))
|
|
||||||
.call(cm -> data.matchesToRemove.isEmpty() ? Uni.createFrom().voidItem() :
|
.call(cm -> data.matchesToRemove.isEmpty() ? Uni.createFrom().voidItem() :
|
||||||
(Panache.withTransaction(
|
(Panache.withTransaction(
|
||||||
() -> matchRepository.delete("id IN ?1 AND category = ?2", data.matchesToRemove, cm))
|
() -> matchRepository.delete("id IN ?1 AND category = ?2", data.matchesToRemove, cm))
|
||||||
.call(__ -> SSMatch.sendDeleteMatch(connection, data.matchesToRemove))))
|
.call(__ -> SSMatch.sendDeleteMatch(connection, data.matchesToRemove))))
|
||||||
.invoke(m -> System.out.println("A0"))
|
|
||||||
.call(cm -> Panache.withSession(() -> matchRepository.list("id IN ?1 AND category = ?2",
|
.call(cm -> Panache.withSession(() -> matchRepository.list("id IN ?1 AND category = ?2",
|
||||||
Stream.concat(data.matchOrderToUpdate.keySet().stream(),
|
Stream.concat(data.matchOrderToUpdate.keySet().stream(),
|
||||||
data.matchPouleToUpdate.keySet().stream())
|
data.matchPouleToUpdate.keySet().stream())
|
||||||
.distinct().toList(), cm)
|
.distinct().toList(), cm)
|
||||||
.invoke(m -> System.out.println("A " + m.size()))
|
|
||||||
.invoke(matchModels -> matchModels.forEach(model -> {
|
.invoke(matchModels -> matchModels.forEach(model -> {
|
||||||
if (data.matchPouleToUpdate.containsKey(model.getId()))
|
if (data.matchPouleToUpdate.containsKey(model.getId()))
|
||||||
model.setPoule(data.matchPouleToUpdate.get(model.getId()));
|
model.setPoule(data.matchPouleToUpdate.get(model.getId()));
|
||||||
if (data.matchOrderToUpdate.containsKey(model.getId()))
|
if (data.matchOrderToUpdate.containsKey(model.getId()))
|
||||||
model.setCategory_ord(data.matchOrderToUpdate.get(model.getId()));
|
model.setCategory_ord(data.matchOrderToUpdate.get(model.getId()));
|
||||||
}))
|
}))
|
||||||
.invoke(m -> System.out.println("B " + m.size()))
|
|
||||||
.call(mm -> mm.isEmpty() ? Uni.createFrom().voidItem() :
|
.call(mm -> mm.isEmpty() ? Uni.createFrom().voidItem() :
|
||||||
Panache.withTransaction(() -> matchRepository.persist(mm)))
|
Panache.withTransaction(() -> matchRepository.persist(mm)))
|
||||||
.invoke(m -> System.out.println("C"))
|
|
||||||
.invoke(mm -> matches.addAll(mm.stream().map(MatchEntity::fromModel).toList())))
|
.invoke(mm -> matches.addAll(mm.stream().map(MatchEntity::fromModel).toList())))
|
||||||
)
|
)
|
||||||
.invoke(m -> System.out.println("D"))
|
|
||||||
.chain(categoryModel -> {
|
.chain(categoryModel -> {
|
||||||
Uni<List<MatchModel>> uni = Uni.createFrom().item(new ArrayList<>());
|
Uni<List<MatchModel>> uni = Uni.createFrom().item(new ArrayList<>());
|
||||||
for (AddMatch match : data.newMatch)
|
for (AddMatch match : data.newMatch)
|
||||||
@ -324,11 +318,9 @@ public class RMatch {
|
|||||||
return Panache.withSession(() -> finalUni);
|
return Panache.withSession(() -> finalUni);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.invoke(m -> System.out.println("E"))
|
|
||||||
.chain(mm -> mm.isEmpty() ? Uni.createFrom().voidItem() :
|
.chain(mm -> mm.isEmpty() ? Uni.createFrom().voidItem() :
|
||||||
Panache.withTransaction(() -> matchRepository.create(mm))
|
Panache.withTransaction(() -> matchRepository.create(mm))
|
||||||
.invoke(__ -> matches.addAll(mm.stream().map(MatchEntity::fromModel).toList())))
|
.invoke(__ -> matches.addAll(mm.stream().map(MatchEntity::fromModel).toList())))
|
||||||
.invoke(m -> System.out.println("F"))
|
|
||||||
.call(__ -> SSMatch.sendMatch(connection, matches))
|
.call(__ -> SSMatch.sendMatch(connection, matches))
|
||||||
.replaceWithVoid();
|
.replaceWithVoid();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user