async update check

This commit is contained in:
olebeck 2023-03-30 13:54:11 +02:00
parent 191f1ecd9a
commit b7ad339a64
1 changed files with 10 additions and 8 deletions

View File

@ -78,14 +78,16 @@ func main() {
logrus.Infof(locale.Loc("bedrocktool_version", locale.Strmap{"Version": utils.Version}))
}
newVersion, err := utils.Updater.UpdateAvailable()
if err != nil {
logrus.Error(err)
}
go func() {
newVersion, err := utils.Updater.UpdateAvailable()
if err != nil {
logrus.Error(err)
}
if newVersion != "" && utils.Version != "" {
logrus.Infof(locale.Loc("update_available", locale.Strmap{"Version": newVersion}))
}
if newVersion != "" && utils.Version != "" {
logrus.Infof(locale.Loc("update_available", locale.Strmap{"Version": newVersion}))
}
}()
ctx, cancel := context.WithCancel(context.Background())
@ -125,7 +127,7 @@ func main() {
logrus.Error("Failed to init UI!")
return
}
err = ui.Start(ctx, cancel)
err := ui.Start(ctx, cancel)
cancel()
if err != nil {
logrus.Error(err)