refactor(controller): changed to use plant token to update, and hardcoded if we use a test server

This commit is contained in:
2025-09-30 06:01:31 -05:00
parent 41a0d241b0
commit 18e57127e2
3 changed files with 8 additions and 1 deletions

View File

@@ -84,7 +84,7 @@ finally {
return
}
server.BroadcastToRoom("/", "update", "updateLogs", fmt.Sprintf("✅ Copy to %s successful", plant))
server.BroadcastToRoom("/", "update", "updateLogs", "done")
}
func lastestBuild() string {

View File

@@ -21,6 +21,8 @@ func UpdateServerStats(buildNumber int64) {
os.Getenv("DATABASE_DB"),
)
fmt.Println(url)
ctx := context.Background()
conn, err := pgx.Connect(ctx, url)

View File

@@ -99,6 +99,11 @@ func triggerRemoteUpdate(server *socketio.Server, token string, payload UpdatePa
body, _ := json.Marshal(payload)
url := fmt.Sprintf("https://%vprod.alpla.net%v/update", token, basePath)
if token == "test1" || token == "test2" || token == "test3" {
url = fmt.Sprintf("https://USMCD1vms036.alpla.net/%v/update", basePath)
}
fmt.Println(url)
//url := fmt.Sprintf("http://%v:8080/api/controller/update", remoteURL)
fmt.Println(url)