mirror of
https://github.com/writefreely/writefreely
synced 2024-11-10 11:24:13 +00:00
Prevent update check from slowing app init
Previously, we'd wait for a response before finishing app initialization, meaning an overall slower startup. This fixes that. Ref T572
This commit is contained in:
parent
8933076296
commit
d17e82d34c
1 changed files with 2 additions and 1 deletions
|
@ -100,7 +100,7 @@ func newUpdatesCache(expiry time.Duration) *updatesCache {
|
||||||
frequency: expiry,
|
frequency: expiry,
|
||||||
currentVersion: "v" + softwareVer,
|
currentVersion: "v" + softwareVer,
|
||||||
}
|
}
|
||||||
cache.CheckNow()
|
go cache.CheckNow()
|
||||||
return &cache
|
return &cache
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,6 +117,7 @@ func newVersionCheck() (string, error) {
|
||||||
if debugging {
|
if debugging {
|
||||||
log.Info("[update check] GET https://version.writefreely.org")
|
log.Info("[update check] GET https://version.writefreely.org")
|
||||||
}
|
}
|
||||||
|
// TODO: return error if statusCode != OK
|
||||||
if err == nil && res.StatusCode == http.StatusOK {
|
if err == nil && res.StatusCode == http.StatusOK {
|
||||||
defer res.Body.Close()
|
defer res.Body.Close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue