fix: remove unused goroutine for guardian
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user