mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-10-01 01:35:48 -04:00
connectionService.getRefreshPeriodMs() is always positive, add docs
This commit is contained in:
parent
72c5632105
commit
057c629629
@ -251,11 +251,7 @@ public final class CoreMoneroConnectionsService {
|
||||
}
|
||||
|
||||
public long getRefreshPeriodMs() {
|
||||
if (connectionList.getRefreshPeriod() < 0 || connectionList.getRefreshPeriod() > 0) {
|
||||
return connectionList.getRefreshPeriod();
|
||||
} else {
|
||||
return getDefaultRefreshPeriodMs();
|
||||
}
|
||||
return connectionList.getRefreshPeriod() > 0 ? connectionList.getRefreshPeriod() : getDefaultRefreshPeriodMs();
|
||||
}
|
||||
|
||||
public void verifyConnection() {
|
||||
@ -526,7 +522,7 @@ public final class CoreMoneroConnectionsService {
|
||||
new Thread(() -> {
|
||||
synchronized (lock) {
|
||||
stopPolling();
|
||||
if (getRefreshPeriodMs() > 0) startPolling();
|
||||
if (connectionList.getRefreshPeriod() >= 0) startPolling(); // 0 means default refresh poll
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public class EncryptedConnectionList implements PersistableEnvelope, PersistedDa
|
||||
|
||||
private final Map<String, EncryptedConnection> items = new HashMap<>();
|
||||
private @NonNull String currentConnectionUrl = "";
|
||||
private long refreshPeriod;
|
||||
private long refreshPeriod; // -1 means no refresh, 0 means default, >0 means custom
|
||||
private boolean autoSwitch;
|
||||
|
||||
@Inject
|
||||
|
Loading…
Reference in New Issue
Block a user