diff --git a/Source/Server/equellaserver/src/com/tle/core/equella/runner/EQUELLAServer.java b/Source/Server/equellaserver/src/com/tle/core/equella/runner/EQUELLAServer.java index 0d86db397e..7ee6e33a2b 100644 --- a/Source/Server/equellaserver/src/com/tle/core/equella/runner/EQUELLAServer.java +++ b/Source/Server/equellaserver/src/com/tle/core/equella/runner/EQUELLAServer.java @@ -75,11 +75,12 @@ public void destroy() { * Method to be called when the OEQ is started as a Windows service. According to the Procrun * documentation, this method should not return until the stop method has been called in JVM mode. */ - public static void start(String[] args) { + public static void start(String[] args) throws InterruptedException { System.out.println("Starting EQUELLA Server..."); main(new String[0]); while (!stopped) { // DO not return until `stop` is called. + Thread.sleep(1000); } } diff --git a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Main.java b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Main.java index bfcf2e9070..464e84b2dc 100644 --- a/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Main.java +++ b/Source/Tools/UpgradeManager/src/com/tle/upgrademanager/Main.java @@ -56,6 +56,8 @@ */ public class Main { private static final Log LOGGER = LogFactory.getLog(Main.class); + // Flag to stop the manager. + private static volatile boolean stop; public static final String EQUELLA_INSTALL_DIRECTORY_KEY = "equella.install.directory"; //$NON-NLS-1$ @@ -65,13 +67,20 @@ public class Main { private static HttpServer server; + /** + * Method to be called when the Manager is started. According to the Procrun documentation, this + * method should not return until the stop method has been called in JVM mode. + */ public static void main(String[] args) throws Exception { if (Check.isEmpty(args) || Check.isEmpty(args[0]) || args[0].equals("start")) // $NON-NLS-1$ { Main m = new Main(); m.startServer(); - } else if (args[0].equals("stop")) // $NON-NLS-1$ - { + while (!stop) { + Thread.sleep(1000); + } + } else if (args[0].equals("stop")) { + stop = true; if (server != null) { server.stop(4); } diff --git a/build.sbt b/build.sbt index d85e1de925..c05566c1dc 100644 --- a/build.sbt +++ b/build.sbt @@ -90,7 +90,7 @@ name := "Equella" (ThisBuild / equellaMajor) := 2024 (ThisBuild / equellaMinor) := 1 -(ThisBuild / equellaPatch) := 0 +(ThisBuild / equellaPatch) := 1 (ThisBuild / equellaStream) := "Stable" (ThisBuild / equellaBuild) := buildConfig.value.getString("build.buildname") (ThisBuild / buildTimestamp) := Instant.now().getEpochSecond diff --git a/checkstyle.sh b/checkstyle.sh index 72563714de..361d37f948 100755 --- a/checkstyle.sh +++ b/checkstyle.sh @@ -3,7 +3,7 @@ ## Run Checkstyle for all the Java files in the project. ## If the number of errors is either greater or smaller than the threshold, output an error message and exit with status 1. -thresholdNumber=449 +thresholdNumber=448 result=$(checkstyle -c checkstyle-config.xml -o checkstyle-report.txt . 2>&1) echo $result