mirror of
https://github.com/safing/portmaster
synced 2025-09-01 18:19:12 +00:00
Merge pull request #104 from safing/feature/updates-context
Use contexts for updates network connections
This commit is contained in:
commit
9bc3f95e9e
2 changed files with 4 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue