mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-12-16 08:14:15 -05:00
Add more logs to republish offer after connection loss, increase delay
This commit is contained in:
parent
546b6f7510
commit
7691b33f6a
1 changed files with 5 additions and 2 deletions
|
|
@ -61,7 +61,7 @@ import static io.bitsquare.util.Validator.nonEmptyStringOf;
|
||||||
public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMessageListener {
|
public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMessageListener {
|
||||||
private static final Logger log = LoggerFactory.getLogger(OpenOfferManager.class);
|
private static final Logger log = LoggerFactory.getLogger(OpenOfferManager.class);
|
||||||
|
|
||||||
private static final long RETRY_REPUBLISH_DELAY_SEC = Timer.STRESS_TEST ? 1 : 5;
|
private static final long RETRY_REPUBLISH_DELAY_SEC = Timer.STRESS_TEST ? 1 : 10;
|
||||||
private static final long REPUBLISH_AGAIN_AT_STARTUP_DELAY_SEC = Timer.STRESS_TEST ? 1 : 10;
|
private static final long REPUBLISH_AGAIN_AT_STARTUP_DELAY_SEC = Timer.STRESS_TEST ? 1 : 10;
|
||||||
private static final long REPUBLISH_INTERVAL_MS = Timer.STRESS_TEST ? 3000 : 2 * Offer.TTL;
|
private static final long REPUBLISH_INTERVAL_MS = Timer.STRESS_TEST ? 3000 : 2 * Offer.TTL;
|
||||||
private static final long REFRESH_INTERVAL_MS = Timer.STRESS_TEST ? 1000 : (long) (Offer.TTL * 0.5);
|
private static final long REFRESH_INTERVAL_MS = Timer.STRESS_TEST ? 1000 : (long) (Offer.TTL * 0.5);
|
||||||
|
|
@ -198,6 +198,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAllConnectionsLost() {
|
public void onAllConnectionsLost() {
|
||||||
|
log.info("onAllConnectionsLost");
|
||||||
stopped = true;
|
stopped = true;
|
||||||
stopPeriodicRefreshOffersTimer();
|
stopPeriodicRefreshOffersTimer();
|
||||||
stopPeriodicRepublishOffersTimer();
|
stopPeriodicRepublishOffersTimer();
|
||||||
|
|
@ -208,12 +209,14 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNewConnectionAfterAllConnectionsLost() {
|
public void onNewConnectionAfterAllConnectionsLost() {
|
||||||
|
log.info("onNewConnectionAfterAllConnectionsLost");
|
||||||
stopped = false;
|
stopped = false;
|
||||||
restart();
|
restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAwakeFromStandby() {
|
public void onAwakeFromStandby() {
|
||||||
|
log.info("onAwakeFromStandby");
|
||||||
stopped = false;
|
stopped = false;
|
||||||
if (!p2PService.getNetworkNode().getAllConnections().isEmpty())
|
if (!p2PService.getNetworkNode().getAllConnections().isEmpty())
|
||||||
restart();
|
restart();
|
||||||
|
|
@ -464,7 +467,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void restart() {
|
private void restart() {
|
||||||
Log.traceCall();
|
log.info("Restart after connection loss");
|
||||||
if (retryRepublishOffersTimer == null)
|
if (retryRepublishOffersTimer == null)
|
||||||
retryRepublishOffersTimer = UserThread.runAfter(() -> {
|
retryRepublishOffersTimer = UserThread.runAfter(() -> {
|
||||||
stopped = false;
|
stopped = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue