fix shut down of trade and wallet services in seed node

This commit is contained in:
woodser 2025-04-25 08:32:41 -04:00 committed by woodser
parent 58506b02f5
commit adcd5da431

View File

@ -151,6 +151,7 @@ public abstract class ExecutableForAppWithP2p extends HavenoExecutable {
UserThread.runAfter(() -> System.exit(HavenoExecutable.EXIT_SUCCESS), 1);
});
});
});
// shut down trade and wallet services
log.info("Shutting down trade and wallet services");
@ -161,13 +162,12 @@ public abstract class ExecutableForAppWithP2p extends HavenoExecutable {
injector.getInstance(XmrConnectionService.class).shutDown();
injector.getInstance(WalletsSetup.class).shutDown();
});
});
// we wait max 5 sec.
UserThread.runAfter(() -> {
PersistenceManager.flushAllDataToDiskAtShutdown(() -> {
resultHandler.handleResult();
log.info("Graceful shutdown caused a timeout. Exiting now.");
log.warn("Graceful shutdown caused a timeout. Exiting now.");
UserThread.runAfter(() -> System.exit(HavenoExecutable.EXIT_SUCCESS), 1);
});
}, 5);