From c6f070bdab348b01830017363f9ddf01a0d954eb Mon Sep 17 00:00:00 2001 From: Julian Arndt Date: Sat, 19 Apr 2025 17:12:05 +0200 Subject: [PATCH] Fix small bug --- jenkinsfiles/TippligaUpdater/Jenkinsfile | 17 ++++++++--------- .../tippligaforum/MatchesListForumUpdater.java | 3 +++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/jenkinsfiles/TippligaUpdater/Jenkinsfile b/jenkinsfiles/TippligaUpdater/Jenkinsfile index 403c980..42fb770 100644 --- a/jenkinsfiles/TippligaUpdater/Jenkinsfile +++ b/jenkinsfiles/TippligaUpdater/Jenkinsfile @@ -20,15 +20,14 @@ pipeline { "JAVA_HOME=${jdkPath}/jdk-22.0.2" ]) { try { - sh "touch log.txt" - sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 1 --configFile Tippliga &>> log.txt" - sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 1 --configFile Tippliga &>> log.txt" - sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 1 --configFile Tippliga &>> log.txt" - sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesResultsUpdater --season ${season} --league 1 --configFile Tippliga &>> log.txt" - sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 2 --configFile Tippliga &>> log.txt" - sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 2 --configFile Tippliga &>> log.txt" - sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 2 --configFile Tippliga &>> log.txt" - sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesResultsUpdater --season ${season} --league 2 --configFile Tippliga &>> log.txt" + sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 1 --configFile Tippliga >> log.txt 2>&1" + sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 1 --configFile Tippliga >> log.txt 2>&1" + sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 1 --configFile Tippliga >> log.txt 2>&1" + sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesResultsUpdater --season ${season} --league 1 --configFile Tippliga >> log.txt 2>&1" + sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesUpdaterFootball --season ${season} --league 2 --configFile Tippliga >> log.txt 2>&1" + sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchdaysUpdater --season ${season} --league 2 --configFile Tippliga >> log.txt 2>&1" + sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode TeamsUpdater --season ${season} --league 2 --configFile Tippliga >> log.txt 2>&1" + sh "$JAVA_HOME/bin/java -jar build/libs/tlw-database-tool-1.0.jar --mode MatchesResultsUpdater --season ${season} --league 2 --configFile Tippliga >> log.txt 2>&1" } catch (Exception e) { telegramSendManual("TLW-Database-Tool crashed!") } diff --git a/src/main/java/de/jeyp91/tippligaforum/MatchesListForumUpdater.java b/src/main/java/de/jeyp91/tippligaforum/MatchesListForumUpdater.java index 2be21d4..e906850 100644 --- a/src/main/java/de/jeyp91/tippligaforum/MatchesListForumUpdater.java +++ b/src/main/java/de/jeyp91/tippligaforum/MatchesListForumUpdater.java @@ -25,6 +25,9 @@ public class MatchesListForumUpdater { public void updateLeague(int season, int league) { MatchesListCreator creator = new MatchesListCreator(season, league); + if(creator.getMatches().isEmpty()) { + return; + } String content = creator.getMatchesBeautiful(); String contentWithCodeBBCode = "[code]" + content + "[/code]"; Integer postId = getPostId(season, creator.getCountry(), creator.getLeagueName());