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