feat(watchdog): implement keepalive mechanism and enhance connection handling
This commit is contained in:
@@ -12,8 +12,8 @@ import (
|
||||
"super-frpc/frpLogger"
|
||||
"super-frpc/global"
|
||||
"super-frpc/postLog"
|
||||
"super-frpc/sys"
|
||||
"super-frpc/session"
|
||||
"super-frpc/sys"
|
||||
"super-frpc/utils"
|
||||
"super-frpc/watchdog"
|
||||
"syscall"
|
||||
@@ -81,6 +81,13 @@ func main() {
|
||||
} else {
|
||||
postLog.Info(fmt.Sprintf("Connected to Watchdog at %s:%d", "127.0.0.1", global.CurrentConfig.Watchdog.Port))
|
||||
global.Is.WatchdogConnected = true
|
||||
|
||||
go func() {
|
||||
if err := watchdog.StartKeepAlive(); err != nil {
|
||||
postLog.Error(fmt.Sprintf("Watchdog keepalive stopped: %v", err))
|
||||
global.Is.WatchdogConnected = false
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user