Move simulation of slowness into LifecycleManager

This commit is contained in:
Sebastian Kürten
2021-02-18 13:20:27 +01:00
parent edd76266a9
commit a56935bc3d
2 changed files with 7 additions and 5 deletions

View File

@@ -179,6 +179,13 @@ class LifecycleManagerImpl implements LifecycleManager, MigrationListener {
LOG.info("Stopping services");
state = STOPPING;
eventBus.broadcast(new LifecycleEvent(STOPPING));
LOG.info("Sleeping a bit to simulate slowness");
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
LOG.info("Done simulating slowness");
for (Service s : services) {
long start = now();
s.stopService();

View File

@@ -146,11 +146,6 @@ public class BriarControllerImpl implements BriarController {
// Shut down the service and wait for it to shut down
LOG.info("Shutting down service");
service.shutdown();
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
service.waitForShutdown();
} catch (InterruptedException e) {
LOG.warning("Interrupted while waiting for service");