mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
Delay the self-check slightly
This commit is contained in:
parent
938a43c300
commit
3027409b74
1 changed files with 3 additions and 2 deletions
|
@ -29,14 +29,15 @@ func prep() error {
|
||||||
func start() error {
|
func start() error {
|
||||||
selfcheckTask = module.NewTask("compatibility self-check", selfcheckTaskFunc).
|
selfcheckTask = module.NewTask("compatibility self-check", selfcheckTaskFunc).
|
||||||
Repeat(1 * time.Minute).
|
Repeat(1 * time.Minute).
|
||||||
StartASAP()
|
MaxDelay(selfcheckTaskRetryAfter).
|
||||||
|
Schedule(time.Now().Add(selfcheckTaskRetryAfter))
|
||||||
|
|
||||||
return module.RegisterEventHook(
|
return module.RegisterEventHook(
|
||||||
netenv.ModuleName,
|
netenv.ModuleName,
|
||||||
netenv.NetworkChangedEvent,
|
netenv.NetworkChangedEvent,
|
||||||
"trigger compat self-check",
|
"trigger compat self-check",
|
||||||
func(_ context.Context, _ interface{}) error {
|
func(_ context.Context, _ interface{}) error {
|
||||||
selfcheckTask.StartASAP()
|
selfcheckTask.Schedule(time.Now().Add(selfcheckTaskRetryAfter))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue