fix(controller): fix for updating iowa2 server

This commit is contained in:
2025-10-20 06:48:29 -05:00
parent af079b8306
commit 358c41deb4

View File

@@ -49,6 +49,18 @@ func UpdateApp(server *socketio.Server) <-chan string {
updates <- msg
server.BroadcastToRoom("/", "update", "updateLogs", msg)
case 1:
var oldService string
var newService string
port := os.Getenv("PORT")
if port == "8081" {
oldService = "LSTV2_2"
newService = "lst_app_2"
} else {
oldService = "LSTV2"
newService = "lst_app"
}
version, err := extractVersion(filepath.Base(zips[0]))
if err != nil {
msg := fmt.Sprintf("could not parse version: %v", err)
@@ -60,9 +72,9 @@ func UpdateApp(server *socketio.Server) <-chan string {
updates <- msg
server.BroadcastToRoom("/", "update", "updateLogs", msg)
// 1. Stop services + pool
stopService("LSTV2")
stopService(oldService)
time.Sleep(1 * time.Second)
stopService("lst_app")
stopService(newService)
//stopAppPool("LogisticsSupportTool")
time.Sleep(1 * time.Second)
@@ -120,9 +132,9 @@ func UpdateApp(server *socketio.Server) <-chan string {
msg = "Starting Services back up"
updates <- msg
server.BroadcastToRoom("/", "update", "updateLogs", msg)
startService("lst_app")
startService(newService)
time.Sleep(2 * time.Second)
startService("LSTV2")
startService(oldService)
time.Sleep(2 * time.Second)
//startAppPool("LogisticsSupportTool")