Clean up linter errors
This commit is contained in:
@@ -95,7 +95,7 @@ func (l *Location) EstimateNetworkProximity(to *Location) (proximity int) {
|
||||
}
|
||||
}
|
||||
|
||||
return //nolint:nakedreturn
|
||||
return //nolint:nakedret
|
||||
}
|
||||
|
||||
// PrimitiveNetworkProximity calculates the numerical distance between two IP addresses. Returns a proximity value between 0 (far away) and 100 (nearby).
|
||||
|
||||
@@ -3,7 +3,6 @@ package geoip
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/safing/portbase/modules"
|
||||
)
|
||||
@@ -22,22 +21,12 @@ func start() error {
|
||||
return fmt.Errorf("goeip: failed to load databases: %s", err)
|
||||
}
|
||||
|
||||
module.RegisterEventHook(
|
||||
return module.RegisterEventHook(
|
||||
"updates",
|
||||
"resource update",
|
||||
"upgrade databases",
|
||||
upgradeDatabases,
|
||||
)
|
||||
|
||||
// TODO: replace with update subscription
|
||||
module.NewTask("update databases", func(ctx context.Context, task *modules.Task) {
|
||||
|
||||
dbFileLock.Lock()
|
||||
defer dbFileLock.Unlock()
|
||||
|
||||
}).Repeat(10 * time.Minute).MaxDelay(1 * time.Hour)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func upgradeDatabases(_ context.Context, _ interface{}) error {
|
||||
|
||||
Reference in New Issue
Block a user