Files
selfcare/proxy/canal/client_fsm.go
2025-03-25 09:46:16 +08:00

29 lines
688 B
Go

package canal
import (
"proxy/logger"
"time"
)
var CurState string= "init"
func CanalFsm(addr string, username string, password string) {
t := time.NewTimer(time.Second * 2)
defer t.Stop()
for {
<-t.C// wait for next tick
//if config.Config.CanalServer.Standalone || (!config.Config.CanalServer.Standalone && rds.CheckIfRdbMaster() == true) {
StartMyCanal(addr, username, password)
logger.CanalLog.Warnf("Exit Canal!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
t.Reset(time.Second * 3)
/*} else {
CurState = "idle"
if config.Config.CanalServer.Reinit {
config.Config.CanalServer.Reinit = false
config.SavePcfCfg()
}
t.Reset(time.Second * 2)
}*/
}
}