fix(user): allow re-login by removing existing session if user is already logged in
fix(main): conditionally initialize and connect to watchdog based on configuration fix(instance): remove unused userID variable and commented debug logs in ListInstancesHandler
This commit is contained in:
@@ -73,23 +73,25 @@ func main() {
|
||||
setupRoutes()
|
||||
|
||||
// Initialize watchdog connection
|
||||
err = watchdog.Init()
|
||||
if err != nil {
|
||||
postLog.Error(fmt.Sprintf("Unable to initialize Watchdog: %s", err))
|
||||
} else {
|
||||
if !watchdog.Connect() {
|
||||
postLog.Error("Failed to connect to Watchdog")
|
||||
if global.CurrentConfig.Watchdog.Enabled {
|
||||
err = watchdog.Init()
|
||||
if err != nil {
|
||||
postLog.Error(fmt.Sprintf("Unable to initialize Watchdog: %s", err))
|
||||
} else {
|
||||
postLog.Info("Connected to Watchdog successfully")
|
||||
if !watchdog.Connect() {
|
||||
postLog.Error("Failed to connect to Watchdog")
|
||||
} else {
|
||||
postLog.Info("Connected to Watchdog successfully")
|
||||
|
||||
go func() {
|
||||
if err := watchdog.StartKeepAlive(); err != nil {
|
||||
postLog.Error(fmt.Sprintf("Watchdog keepalive stopped: %v", err))
|
||||
global.Is.WatchdogConnected = false
|
||||
}
|
||||
}()
|
||||
go func() {
|
||||
if err := watchdog.StartKeepAlive(); err != nil {
|
||||
postLog.Error(fmt.Sprintf("Watchdog keepalive stopped: %v", err))
|
||||
global.Is.WatchdogConnected = false
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addr := fmt.Sprintf("%s:%s", global.CurrentConfig.ListenAddr, global.CurrentConfig.ListenPort)
|
||||
server := &http.Server{
|
||||
|
||||
Reference in New Issue
Block a user