- // In a different state in order to avois interruptions
- new Thread(() -> applyStopHooks(), "Apply Argeo Stop Hooks").start();
- // applyStopHooks();
+ // In a different thread in order to avoid interruptions
+ Thread stopHookThread = new Thread(() -> applyStopHooks(), "Apply Argeo Stop Hooks");
+ stopHookThread.start();
+ try {
+ stopHookThread.join(10 * 60 * 1000);
+ } catch (InterruptedException e) {
+ // silent
+ }