finish open offer manager tasks before shut down
This commit is contained in:
parent
e2e2963b99
commit
7f3fd0af08
@ -316,6 +316,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
|||||||
int size = openOffers.size();
|
int size = openOffers.size();
|
||||||
log.info("Remove open offers at shutDown. Number of open offers: {}", size);
|
log.info("Remove open offers at shutDown. Number of open offers: {}", size);
|
||||||
if (offerBookService.isBootstrapped() && size > 0) {
|
if (offerBookService.isBootstrapped() && size > 0) {
|
||||||
|
HavenoUtils.submitToThread(() -> { // finish tasks
|
||||||
UserThread.execute(() -> {
|
UserThread.execute(() -> {
|
||||||
openOffers.forEach(openOffer -> offerBookService.removeOfferAtShutDown(openOffer.getOffer().getOfferPayload()));
|
openOffers.forEach(openOffer -> offerBookService.removeOfferAtShutDown(openOffer.getOffer().getOfferPayload()));
|
||||||
|
|
||||||
@ -330,6 +331,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
|||||||
UserThread.runAfter(completeHandler, delay, TimeUnit.MILLISECONDS);
|
UserThread.runAfter(completeHandler, delay, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}, THREAD_ID);
|
||||||
} else {
|
} else {
|
||||||
broadcaster.flush();
|
broadcaster.flush();
|
||||||
if (completeHandler != null)
|
if (completeHandler != null)
|
||||||
|
Loading…
Reference in New Issue
Block a user