mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-04 21:36:45 +00:00
followup
This commit is contained in:
parent
f14e2fb020
commit
8f52039c7b
1 changed files with 4 additions and 17 deletions
|
@ -78,8 +78,8 @@ public class AppServices {
|
||||||
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 int CONNECTION_DELAY_SECS = 2;
|
private static final int CONNECTION_DELAY_SECS = 2;
|
||||||
private static final int RATES_STARTUP_DELAY_SECS_DEFAULT = 2;
|
private static final int RATES_DELAY_SECS_DEFAULT = 2;
|
||||||
private static final int RATES_STARTUP_DELAY_SECS_WINDOWS = 5;
|
private static final int RATES_DELAY_SECS_WINDOWS = 5;
|
||||||
private static final ExchangeSource DEFAULT_EXCHANGE_SOURCE = ExchangeSource.COINGECKO;
|
private static final ExchangeSource DEFAULT_EXCHANGE_SOURCE = ExchangeSource.COINGECKO;
|
||||||
private static final Currency DEFAULT_FIAT_CURRENCY = Currency.getInstance("USD");
|
private static final Currency DEFAULT_FIAT_CURRENCY = Currency.getInstance("USD");
|
||||||
private static final String TOR_DEFAULT_PROXY_CIRCUIT_ID = "default";
|
private static final String TOR_DEFAULT_PROXY_CIRCUIT_ID = "default";
|
||||||
|
@ -357,21 +357,8 @@ public class AppServices {
|
||||||
ExchangeSource.RatesService ratesService = new ExchangeSource.RatesService(
|
ExchangeSource.RatesService ratesService = new ExchangeSource.RatesService(
|
||||||
exchangeSource == null ? DEFAULT_EXCHANGE_SOURCE : exchangeSource,
|
exchangeSource == null ? DEFAULT_EXCHANGE_SOURCE : exchangeSource,
|
||||||
currency == null ? DEFAULT_FIAT_CURRENCY : currency);
|
currency == null ? DEFAULT_FIAT_CURRENCY : currency);
|
||||||
//Delay startup on first run
|
//Delay startup on first run, Windows requires a longer delay
|
||||||
switch(org.controlsfx.tools.Platform.getCurrent())
|
ratesService.setDelay(org.controlsfx.tools.Platform.getCurrent() == org.controlsfx.tools.Platform.WINDOWS ? Duration.seconds(RATES_DELAY_SECS_WINDOWS) : Duration.seconds(RATES_DELAY_SECS_DEFAULT));
|
||||||
{
|
|
||||||
case WINDOWS:
|
|
||||||
//Windows needs more time (5 Seconds)
|
|
||||||
ratesService.setDelay(Duration.seconds(RATES_STARTUP_DELAY_SECS_WINDOWS));
|
|
||||||
break;
|
|
||||||
case OSX:
|
|
||||||
case UNIX:
|
|
||||||
case UNKNOWN:
|
|
||||||
default:
|
|
||||||
//Other platforms seem ok with 2 Seconds
|
|
||||||
ratesService.setDelay(Duration.seconds(RATES_STARTUP_DELAY_SECS_DEFAULT));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
ratesService.setPeriod(Duration.seconds(RATES_PERIOD_SECS));
|
ratesService.setPeriod(Duration.seconds(RATES_PERIOD_SECS));
|
||||||
ratesService.setRestartOnFailure(true);
|
ratesService.setRestartOnFailure(true);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue