increase the request timeout in frontend if the timeout of requesting third-party exchange rates api exceeds the default time

This commit is contained in:
MaysWind
2024-11-16 21:13:37 +08:00
parent f554fdefd3
commit 65a92042d6
4 changed files with 32 additions and 6 deletions
+10 -4
View File
@@ -328,10 +328,11 @@ type Config struct {
CustomMapTileServerDefaultZoomLevel uint8
// Exchange Rates
ExchangeRatesDataSource string
ExchangeRatesRequestTimeout uint32
ExchangeRatesProxy string
ExchangeRatesSkipTLSVerify bool
ExchangeRatesDataSource string
ExchangeRatesRequestTimeout uint32
ExchangeRatesRequestTimeoutExceedDefaultValue bool
ExchangeRatesProxy string
ExchangeRatesSkipTLSVerify bool
}
// LoadConfiguration loads setting config from given config file path
@@ -910,6 +911,11 @@ func loadExchangeRatesConfiguration(config *Config, configFile *ini.File, sectio
config.ExchangeRatesProxy = getConfigItemStringValue(configFile, sectionName, "proxy", "system")
config.ExchangeRatesRequestTimeout = getConfigItemUint32Value(configFile, sectionName, "request_timeout", defaultExchangeRatesDataRequestTimeout)
if config.ExchangeRatesRequestTimeout > defaultExchangeRatesDataRequestTimeout {
config.ExchangeRatesRequestTimeoutExceedDefaultValue = true
}
config.ExchangeRatesSkipTLSVerify = getConfigItemBoolValue(configFile, sectionName, "skip_tls_verify", false)
return nil