Merge pull request #104 from safing/feature/updates-context

Use contexts for updates network connections
This commit is contained in:
Patrick Pacher 2020-07-21 16:53:48 +02:00 committed by GitHub
commit 9bc3f95e9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -1,6 +1,7 @@
package main
import (
"context"
"errors"
"fmt"
"log"
@ -212,7 +213,7 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) {
}
func updateRegistryIndex() {
err := registry.LoadIndexes()
err := registry.LoadIndexes(context.TODO())
if err != nil {
log.Printf("WARNING: error loading indexes: %s\n", err)
}

View file

@ -150,7 +150,7 @@ func start() error {
Beta: false,
})
err = registry.LoadIndexes()
err = registry.LoadIndexes(module.Ctx)
if err != nil {
log.Warningf("updates: failed to load indexes: %s", err)
}
@ -234,7 +234,7 @@ func checkForUpdates(ctx context.Context) (err error) {
}
}()
if err = registry.UpdateIndexes(); err != nil {
if err = registry.UpdateIndexes(ctx); err != nil {
log.Warningf("updates: failed to update indexes: %s", err)
}