Skip to content

Commit

Permalink
Merge pull request #4843 from chimp1984/add-delay-to-exit
Browse files Browse the repository at this point in the history
Add 1 sec delay before calling exit
  • Loading branch information
ripcurlx committed Nov 24, 2020
2 parents 94453cf + 788e025 commit f054e92
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions core/src/main/java/bisq/core/app/BisqExecutable.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,10 @@ public void gracefulShutDown(ResultHandler resultHandler) {
PersistenceManager.flushAllDataToDisk(() -> {
log.info("Graceful shutdown completed. Exiting now.");
resultHandler.handleResult();
System.exit(EXIT_SUCCESS);
UserThread.runAfter(() -> System.exit(EXIT_SUCCESS), 1);
});
} else {
System.exit(EXIT_SUCCESS);
UserThread.runAfter(() -> System.exit(EXIT_SUCCESS), 1);
}
});
});
Expand All @@ -269,10 +269,10 @@ public void gracefulShutDown(ResultHandler resultHandler) {
PersistenceManager.flushAllDataToDisk(() -> {
log.info("Graceful shutdown resulted in a timeout. Exiting now.");
resultHandler.handleResult();
System.exit(EXIT_SUCCESS);
UserThread.runAfter(() -> System.exit(EXIT_SUCCESS), 1);
});
} else {
System.exit(EXIT_SUCCESS);
UserThread.runAfter(() -> System.exit(EXIT_SUCCESS), 1);
}

}, 20);
Expand All @@ -284,10 +284,10 @@ public void gracefulShutDown(ResultHandler resultHandler) {
PersistenceManager.flushAllDataToDisk(() -> {
log.info("Graceful shutdown resulted in an error. Exiting now.");
resultHandler.handleResult();
System.exit(EXIT_FAILURE);
UserThread.runAfter(() -> System.exit(EXIT_FAILURE), 1);
});
} else {
System.exit(EXIT_FAILURE);
UserThread.runAfter(() -> System.exit(EXIT_FAILURE), 1);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void gracefulShutDown(ResultHandler resultHandler) {
PersistenceManager.flushAllDataToDisk(() -> {
resultHandler.handleResult();
log.info("Graceful shutdown completed. Exiting now.");
System.exit(BisqExecutable.EXIT_SUCCESS);
UserThread.runAfter(() -> System.exit(BisqExecutable.EXIT_SUCCESS), 1);
});
});
injector.getInstance(WalletsSetup.class).shutDown();
Expand All @@ -107,7 +107,7 @@ public void gracefulShutDown(ResultHandler resultHandler) {
PersistenceManager.flushAllDataToDisk(() -> {
resultHandler.handleResult();
log.info("Graceful shutdown caused a timeout. Exiting now.");
System.exit(BisqExecutable.EXIT_SUCCESS);
UserThread.runAfter(() -> System.exit(BisqExecutable.EXIT_SUCCESS), 1);
});
}, 5);
} else {
Expand All @@ -122,7 +122,7 @@ public void gracefulShutDown(ResultHandler resultHandler) {
PersistenceManager.flushAllDataToDisk(() -> {
resultHandler.handleResult();
log.info("Graceful shutdown resulted in an error. Exiting now.");
System.exit(BisqExecutable.EXIT_FAILURE);
UserThread.runAfter(() -> System.exit(BisqExecutable.EXIT_FAILURE), 1);
});

}
Expand Down

0 comments on commit f054e92

Please sign in to comment.