From 54ba4ef73aad000b328aa18ae1bf7bd8a6d9a4e1 Mon Sep 17 00:00:00 2001 From: gsd Date: Thu, 9 Mar 2023 21:52:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B5=20=D0=BD=D1=83=20=D1=8F=20=D0=B4?= =?UTF-8?q?=D1=83=D1=80=D0=B0=D1=87=D0=B5=D0=BA=20=D0=BA=D0=BE=D0=BD=D0=B5?= =?UTF-8?q?=D1=87=D0=BD=D0=BE,=20=D0=BD=D0=B0=D0=B4=D0=BE=20=D0=BD=D0=B5?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=B1=D1=8B=D1=82=D1=8C=20=D1=87=D1=82=D0=BE=20?= =?UTF-8?q?=D1=82=D1=80=D0=B0=D0=BD=D0=B7=D0=B0=D0=BA=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D0=BE=D0=B2=20=D0=B4=D0=BE=D0=BB?= =?UTF-8?q?=D0=B6=D0=BD=D1=8B=20=D0=B8=20=D0=B2=D0=BA=D0=BB=D0=B0=D1=81?= =?UTF-8?q?=D1=81=D0=B5=20=D0=B1=D1=8B=D1=82=D1=8C=20=D1=8D=D1=82=D0=BE=20?= =?UTF-8?q?=D0=B2=D0=B5=D0=B4=D1=8C=20=D0=BD=D0=B5=20=D1=80=D0=B5=D0=BF?= =?UTF-8?q?=D0=BE=D0=B7=D0=B8=D1=82=D0=B0=D1=80=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/app/entities/a2s/external/ExternalValveClient.java | 2 +- src/main/java/app/services/db/BanService.java | 1 + src/main/java/app/services/db/DiscordAuthService.java | 1 + src/main/java/app/services/db/FreeVIPService.java | 3 ++- src/main/java/app/services/db/PermitionService.java | 1 + src/main/java/app/services/db/UsertimeService.java | 2 ++ 6 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/app/entities/a2s/external/ExternalValveClient.java b/src/main/java/app/entities/a2s/external/ExternalValveClient.java index 79fc26a..4c0cdad 100644 --- a/src/main/java/app/entities/a2s/external/ExternalValveClient.java +++ b/src/main/java/app/entities/a2s/external/ExternalValveClient.java @@ -62,7 +62,7 @@ public abstract class ExternalValveClient { try { return new ArrayList<>(Arrays.asList(restTemplate.postForEntity("%s/api/players".formatted(gateway), request, RCONPlayer[].class).getBody())); } catch (Exception err) { - err.printStackTrace(); + System.out.printf("Cannot get rcon players from %s", request.getServer()); return new ArrayList<>(); } } diff --git a/src/main/java/app/services/db/BanService.java b/src/main/java/app/services/db/BanService.java index d387094..abe2bff 100644 --- a/src/main/java/app/services/db/BanService.java +++ b/src/main/java/app/services/db/BanService.java @@ -15,6 +15,7 @@ import java.sql.Timestamp; import java.util.List; @Service +@Transactional public class BanService { @PersistenceContext EntityManager entityManager; diff --git a/src/main/java/app/services/db/DiscordAuthService.java b/src/main/java/app/services/db/DiscordAuthService.java index e2e8e07..67209ac 100644 --- a/src/main/java/app/services/db/DiscordAuthService.java +++ b/src/main/java/app/services/db/DiscordAuthService.java @@ -8,6 +8,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Service +@Transactional public class DiscordAuthService { @PersistenceContext EntityManager entityManager; diff --git a/src/main/java/app/services/db/FreeVIPService.java b/src/main/java/app/services/db/FreeVIPService.java index 7990505..d0a2457 100644 --- a/src/main/java/app/services/db/FreeVIPService.java +++ b/src/main/java/app/services/db/FreeVIPService.java @@ -18,7 +18,8 @@ import java.util.List; import java.util.Map; @Service -public class FreeVIPService { +@Transactional +public class FreeVIPService{ @PersistenceContext EntityManager entityManager; diff --git a/src/main/java/app/services/db/PermitionService.java b/src/main/java/app/services/db/PermitionService.java index 8bcee13..785af94 100644 --- a/src/main/java/app/services/db/PermitionService.java +++ b/src/main/java/app/services/db/PermitionService.java @@ -12,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service +@Transactional public class PermitionService { @PersistenceContext EntityManager entityManager; diff --git a/src/main/java/app/services/db/UsertimeService.java b/src/main/java/app/services/db/UsertimeService.java index a9bc8d0..2cd5d79 100644 --- a/src/main/java/app/services/db/UsertimeService.java +++ b/src/main/java/app/services/db/UsertimeService.java @@ -8,12 +8,14 @@ import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; import java.sql.Timestamp; import java.util.*; @Service +@Transactional public class UsertimeService { @PersistenceContext