style: rename controllers to login, cancel internal/pkg
This commit is contained in:
20
internal/login/guardian.go
Normal file
20
internal/login/guardian.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package login
|
||||
|
||||
import (
|
||||
"github.com/Mmx233/BitSrunLoginGo/internal/config"
|
||||
"github.com/Mmx233/BitSrunLoginGo/internal/config/keys"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Guardian 守护模式逻辑
|
||||
func Guardian(logger log.FieldLogger) {
|
||||
GuardianDuration := time.Duration(config.Settings.Guardian.Duration) * time.Second
|
||||
for {
|
||||
_ = Login(Conf{
|
||||
Logger: logger.WithField(keys.LogComponent, "login"),
|
||||
IsOnlineDetectLogDebugLevel: true,
|
||||
})
|
||||
time.Sleep(GuardianDuration)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user