NIFI-884 Moving deletion of pid file from beginning of stop() to after a successful stop

This commit is contained in:
Bryan Bende 2015-08-21 15:59:29 -04:00
parent 1f6805f06d
commit 0931c6b0d6
1 changed files with 4 additions and 5 deletions

View File

@ -499,11 +499,6 @@ public class RunNiFi {
final Properties nifiProps = loadProperties(logger); final Properties nifiProps = loadProperties(logger);
final String secretKey = nifiProps.getProperty("secret.key"); final String secretKey = nifiProps.getProperty("secret.key");
final File statusFile = getStatusFile(logger);
if (statusFile.exists() && !statusFile.delete()) {
logger.error("Failed to delete status file {}; this file should be cleaned up manually", statusFile);
}
try (final Socket socket = new Socket()) { try (final Socket socket = new Socket()) {
logger.debug("Connecting to NiFi instance"); logger.debug("Connecting to NiFi instance");
socket.setSoTimeout(60000); socket.setSoTimeout(60000);
@ -568,6 +563,10 @@ public class RunNiFi {
} }
} }
final File statusFile = getStatusFile(logger);
if (statusFile.exists() && !statusFile.delete()) {
logger.error("Failed to delete status file {}; this file should be cleaned up manually", statusFile);
}
logger.info("NiFi has finished shutting down."); logger.info("NiFi has finished shutting down.");
} }
} else { } else {