CORE-12019 Add a Fast Check for already running CSDE before trying to start it

This commit is contained in:
Emil Gabrovski 2023-03-27 10:36:36 +03:00 committed by egabrovski-r3
parent d12f25b300
commit bedc850dea

View File

@ -24,7 +24,11 @@ public class CordaLifeCycleHelper {
}
public void startCorda() throws IOException {
PrintStream pidStore = new PrintStream(new FileOutputStream(pc.cordaPidCache));
File cordaPIDFile = new File(pc.cordaPidCache);
if (cordaPIDFile.exists()) {
throw new IOException("Cannot start the Combined worker\nCached process ID file " + cordaPIDFile + " existing.\nWas the combined worker already started?");
}
PrintStream pidStore = new PrintStream(new FileOutputStream(cordaPIDFile));
File combinedWorkerJar = pc.project.getConfigurations().getByName("combinedWorker").getSingleFile();
// Manual version of the command to start postgres (for reference):