Run release check in the background when toggling the setting (#169)

* Run release check in the background when toggling the setting

* change var name

* use new err variable
This commit is contained in:
Evan Simkowitz 2023-12-18 17:19:11 -08:00 committed by GitHub
parent 03b1e410e7
commit 226699732d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4106,10 +4106,14 @@ func ReleaseCheckOnCommand(ctx context.Context, pk *scpacket.FeCommandPacketType
return nil, err
}
err = runReleaseCheck(ctx, true)
if err != nil {
log.Printf("error checking for new release after enabling auto release check: %v\n", err)
}
go func() {
releaseCheckCtx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()
releaseCheckErr := runReleaseCheck(releaseCheckCtx, true)
if releaseCheckErr != nil {
log.Printf("error checking for new release after enabling auto release check: %v\n", releaseCheckErr)
}
}()
clientData, err = sstore.EnsureClientData(ctx)
if err != nil {