mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-03-24 08:09:05 +00:00
connectionService.getRefreshPeriodMs() is always positive, add docs
This commit is contained in:
parent
72c5632105
commit
057c629629
2 changed files with 3 additions and 7 deletions
|
@ -251,11 +251,7 @@ public final class CoreMoneroConnectionsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getRefreshPeriodMs() {
|
public long getRefreshPeriodMs() {
|
||||||
if (connectionList.getRefreshPeriod() < 0 || connectionList.getRefreshPeriod() > 0) {
|
return connectionList.getRefreshPeriod() > 0 ? connectionList.getRefreshPeriod() : getDefaultRefreshPeriodMs();
|
||||||
return connectionList.getRefreshPeriod();
|
|
||||||
} else {
|
|
||||||
return getDefaultRefreshPeriodMs();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void verifyConnection() {
|
public void verifyConnection() {
|
||||||
|
@ -526,7 +522,7 @@ public final class CoreMoneroConnectionsService {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
stopPolling();
|
stopPolling();
|
||||||
if (getRefreshPeriodMs() > 0) startPolling();
|
if (connectionList.getRefreshPeriod() >= 0) startPolling(); // 0 means default refresh poll
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class EncryptedConnectionList implements PersistableEnvelope, PersistedDa
|
||||||
|
|
||||||
private final Map<String, EncryptedConnection> items = new HashMap<>();
|
private final Map<String, EncryptedConnection> items = new HashMap<>();
|
||||||
private @NonNull String currentConnectionUrl = "";
|
private @NonNull String currentConnectionUrl = "";
|
||||||
private long refreshPeriod;
|
private long refreshPeriod; // -1 means no refresh, 0 means default, >0 means custom
|
||||||
private boolean autoSwitch;
|
private boolean autoSwitch;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|
Loading…
Reference in a new issue