increase offer reliability with TTL, refresh period, max attempts

This commit is contained in:
woodser 2023-12-23 06:09:48 -05:00
parent 0d33959eeb
commit 3de4264c4b
3 changed files with 4 additions and 4 deletions

View File

@ -55,7 +55,7 @@ import java.util.concurrent.TimeUnit;
@Getter
@Slf4j
public final class OfferPayload implements ProtectedStoragePayload, ExpirablePayload, RequiresOwnerIsOnlinePayload {
public static final long TTL = TimeUnit.MINUTES.toMillis(9);
public static final long TTL = TimeUnit.MINUTES.toMillis(11);
protected final String id;
protected final long date;

View File

@ -112,8 +112,8 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
private static final String THREAD_ID = OpenOfferManager.class.getSimpleName();
private static final long RETRY_REPUBLISH_DELAY_SEC = 10;
private static final long REPUBLISH_AGAIN_AT_STARTUP_DELAY_SEC = 30;
private static final long REPUBLISH_INTERVAL_MS = TimeUnit.MINUTES.toMillis(40);
private static final long REFRESH_INTERVAL_MS = TimeUnit.MINUTES.toMillis(6);
private static final long REPUBLISH_INTERVAL_MS = TimeUnit.MINUTES.toMillis(30);
private static final long REFRESH_INTERVAL_MS = OfferPayload.TTL / 2;
private final CoreContext coreContext;
private final KeyRing keyRing;

View File

@ -33,7 +33,7 @@ import java.util.Date;
@Getter
@Slf4j
public final class Peer implements HasCapabilities, NetworkPayload, PersistablePayload, SupportedCapabilitiesListener {
private static final int MAX_FAILED_CONNECTION_ATTEMPTS = 5;
private static final int MAX_FAILED_CONNECTION_ATTEMPTS = 6;
private final NodeAddress nodeAddress;
private final long date;