mirror of
https://github.com/safing/portmaster
synced 2025-09-04 03:29: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
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
@ -212,7 +213,7 @@ func cmdSetup(cmd *cobra.Command, args []string) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateRegistryIndex() {
|
func updateRegistryIndex() {
|
||||||
err := registry.LoadIndexes()
|
err := registry.LoadIndexes(context.TODO())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("WARNING: error loading indexes: %s\n", err)
|
log.Printf("WARNING: error loading indexes: %s\n", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,7 +150,7 @@ func start() error {
|
||||||
Beta: false,
|
Beta: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
err = registry.LoadIndexes()
|
err = registry.LoadIndexes(module.Ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warningf("updates: failed to load indexes: %s", err)
|
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)
|
log.Warningf("updates: failed to update indexes: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue