mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
make usb hw enumerate period configurable
This commit is contained in:
parent
218761c594
commit
e0b00513b9
2 changed files with 8 additions and 2 deletions
|
@ -70,7 +70,7 @@ public class AppServices {
|
||||||
|
|
||||||
private static final int SERVER_PING_PERIOD_SECS = 60;
|
private static final int SERVER_PING_PERIOD_SECS = 60;
|
||||||
private static final int PUBLIC_SERVER_RETRY_PERIOD_SECS = 3;
|
private static final int PUBLIC_SERVER_RETRY_PERIOD_SECS = 3;
|
||||||
private static final int ENUMERATE_HW_PERIOD_SECS = 30;
|
public static final int ENUMERATE_HW_PERIOD_SECS = 30;
|
||||||
private static final int RATES_PERIOD_SECS = 5 * 60;
|
private static final int RATES_PERIOD_SECS = 5 * 60;
|
||||||
private static final int VERSION_CHECK_PERIOD_HOURS = 24;
|
private static final int VERSION_CHECK_PERIOD_HOURS = 24;
|
||||||
private static final ExchangeSource DEFAULT_EXCHANGE_SOURCE = ExchangeSource.COINGECKO;
|
private static final ExchangeSource DEFAULT_EXCHANGE_SOURCE = ExchangeSource.COINGECKO;
|
||||||
|
@ -358,7 +358,7 @@ public class AppServices {
|
||||||
|
|
||||||
private Hwi.ScheduledEnumerateService createDeviceEnumerateService() {
|
private Hwi.ScheduledEnumerateService createDeviceEnumerateService() {
|
||||||
Hwi.ScheduledEnumerateService enumerateService = new Hwi.ScheduledEnumerateService(null);
|
Hwi.ScheduledEnumerateService enumerateService = new Hwi.ScheduledEnumerateService(null);
|
||||||
enumerateService.setPeriod(Duration.seconds(ENUMERATE_HW_PERIOD_SECS));
|
enumerateService.setPeriod(Duration.seconds(Config.get().getEnumerateHwPeriod()));
|
||||||
enumerateService.setOnSucceeded(workerStateEvent -> {
|
enumerateService.setOnSucceeded(workerStateEvent -> {
|
||||||
List<Device> devices = enumerateService.getValue();
|
List<Device> devices = enumerateService.getValue();
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ import java.lang.reflect.Type;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static com.sparrowwallet.sparrow.AppServices.ENUMERATE_HW_PERIOD_SECS;
|
||||||
import static com.sparrowwallet.sparrow.net.PagedBatchRequestBuilder.DEFAULT_PAGE_SIZE;
|
import static com.sparrowwallet.sparrow.net.PagedBatchRequestBuilder.DEFAULT_PAGE_SIZE;
|
||||||
import static com.sparrowwallet.sparrow.net.TcpTransport.DEFAULT_MAX_TIMEOUT;
|
import static com.sparrowwallet.sparrow.net.TcpTransport.DEFAULT_MAX_TIMEOUT;
|
||||||
|
|
||||||
|
@ -45,6 +46,7 @@ public class Config {
|
||||||
private List<File> recentWalletFiles;
|
private List<File> recentWalletFiles;
|
||||||
private Integer keyDerivationPeriod;
|
private Integer keyDerivationPeriod;
|
||||||
private File hwi;
|
private File hwi;
|
||||||
|
private int enumerateHwPeriod = ENUMERATE_HW_PERIOD_SECS;
|
||||||
private Boolean hdCapture;
|
private Boolean hdCapture;
|
||||||
private String webcamDevice;
|
private String webcamDevice;
|
||||||
private ServerType serverType;
|
private ServerType serverType;
|
||||||
|
@ -309,6 +311,10 @@ public class Config {
|
||||||
flush();
|
flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getEnumerateHwPeriod() {
|
||||||
|
return enumerateHwPeriod;
|
||||||
|
}
|
||||||
|
|
||||||
public Boolean getHdCapture() {
|
public Boolean getHdCapture() {
|
||||||
return hdCapture;
|
return hdCapture;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue