Increase timout for shutdown, reduce delay at remove offers at shutdown

This commit is contained in:
Manfred Karrer 2016-07-19 19:00:59 +02:00
parent ee9df3e476
commit f15bbf98eb
2 changed files with 4 additions and 4 deletions

View File

@ -160,7 +160,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
if (offerBookService.isBootstrapped()) { if (offerBookService.isBootstrapped()) {
openOffers.forEach(openOffer -> offerBookService.removeOfferAtShutDown(openOffer.getOffer())); openOffers.forEach(openOffer -> offerBookService.removeOfferAtShutDown(openOffer.getOffer()));
if (completeHandler != null) if (completeHandler != null)
UserThread.runAfter(completeHandler::run, size * 500 + 500, TimeUnit.MILLISECONDS); UserThread.runAfter(completeHandler::run, size * 50 + 500, TimeUnit.MILLISECONDS);
} else { } else {
if (completeHandler != null) if (completeHandler != null)
completeHandler.run(); completeHandler.run();
@ -174,7 +174,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
}, errorMessage -> { }, errorMessage -> {
})); }));
if (completeHandler != null) if (completeHandler != null)
UserThread.runAfter(completeHandler::run, size * 500 + 500, TimeUnit.MILLISECONDS); UserThread.runAfter(completeHandler::run, size * 50 + 500, TimeUnit.MILLISECONDS);
} }
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////

View File

@ -379,8 +379,8 @@ public class BitsquareApp extends Application {
injector.getInstance(WalletService.class).shutDown(); injector.getInstance(WalletService.class).shutDown();
}); });
}); });
// we wait max 5 sec. // we wait max 20 sec.
UserThread.runAfter(resultHandler::handleResult, 5); UserThread.runAfter(resultHandler::handleResult, 20);
} else { } else {
UserThread.runAfter(resultHandler::handleResult, 1); UserThread.runAfter(resultHandler::handleResult, 1);
} }