mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 07:09:56 +01:00
Move simulation of slowness into LifecycleManager
This commit is contained in:
@@ -179,6 +179,13 @@ class LifecycleManagerImpl implements LifecycleManager, MigrationListener {
|
|||||||
LOG.info("Stopping services");
|
LOG.info("Stopping services");
|
||||||
state = STOPPING;
|
state = STOPPING;
|
||||||
eventBus.broadcast(new LifecycleEvent(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) {
|
for (Service s : services) {
|
||||||
long start = now();
|
long start = now();
|
||||||
s.stopService();
|
s.stopService();
|
||||||
|
|||||||
@@ -146,11 +146,6 @@ public class BriarControllerImpl implements BriarController {
|
|||||||
// Shut down the service and wait for it to shut down
|
// Shut down the service and wait for it to shut down
|
||||||
LOG.info("Shutting down service");
|
LOG.info("Shutting down service");
|
||||||
service.shutdown();
|
service.shutdown();
|
||||||
try {
|
|
||||||
Thread.sleep(5000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
service.waitForShutdown();
|
service.waitForShutdown();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
LOG.warning("Interrupted while waiting for service");
|
LOG.warning("Interrupted while waiting for service");
|
||||||
|
|||||||
Reference in New Issue
Block a user