fix(@desktop/updates): using timeout when checking for new version

This commit is contained in:
Andrei Smirnov 2021-09-07 14:44:58 +03:00 committed by Iuri Matias
parent 4bef4533b6
commit 3902ddf002
2 changed files with 4 additions and 3 deletions

View File

@ -6,4 +6,5 @@ export KEYSTOREDIR
export TMPDIR
export LOGDIR
const APP_UPDATES_ENS* = "desktop.status.eth"
const APP_UPDATES_ENS* = "desktop.status.eth"
const CHECK_VERSION_TIMEOUT_MS* = 5000

View File

@ -34,8 +34,8 @@ proc getLatestVersion*(): VersionInfo =
# Read version from folder
let secureSSLContext = newContext()
let client = newHttpClient(sslContext = secureSSLContext)
result.version = client.getContent(url & "/VERSION" ).strip()
let client = newHttpClient(sslContext = secureSSLContext, timeout = CHECK_VERSION_TIMEOUT_MS)
result.version = client.getContent(url & "/VERSION").strip()
result.url = url
proc isNewer*(currentVersion, versionToCheck: string): bool =