fix: remove unused goroutine for guardian

This commit is contained in:
Mmx
2024-09-24 23:54:51 +08:00
parent e68bd88e05
commit 1d753419bc

View File

@@ -2,9 +2,8 @@ package controllers
import (
"github.com/Mmx233/BitSrunLoginGo/internal/config"
"time"
"github.com/Mmx233/BitSrunLoginGo/tools"
"time"
)
// Guardian 守护模式逻辑
@@ -15,9 +14,7 @@ func Guardian() {
GuardianDuration := time.Duration(config.Settings.Guardian.Duration) * time.Second
var c = make(chan bool)
for {
go func() {
if config.Settings.Basic.Interfaces == "" { //单网卡
err := Login(nil, true)
if err != nil {
@@ -35,10 +32,6 @@ func Guardian() {
}
}
}
c <- false
}()
<-c
time.Sleep(GuardianDuration)
}
}