feat(app): stats added in to check if build in last build and also if theres a pending file

This commit is contained in:
2025-09-26 10:44:41 -05:00
parent 86dea6083e
commit 58aedecd4d
25 changed files with 2113 additions and 42 deletions

View File

@@ -15,6 +15,7 @@ import (
"time"
socketio "github.com/googollee/go-socket.io"
"lst.net/pkg"
)
func UpdateApp(server *socketio.Server) <-chan string {
@@ -54,6 +55,7 @@ func UpdateApp(server *socketio.Server) <-chan string {
updates <- msg
server.BroadcastToRoom("/", "update", "updateLogs", msg)
}
msg := "Stopping the services"
updates <- msg
server.BroadcastToRoom("/", "update", "updateLogs", msg)
@@ -127,6 +129,16 @@ func UpdateApp(server *socketio.Server) <-chan string {
msg = "Deployment finished successfully"
updates <- msg
// remove the prefix
cleaned := strings.Replace(strconv.Itoa(version), "release-", "", 1)
num, err := strconv.Atoi(cleaned)
if err != nil {
fmt.Println("Error parsing number:", err)
}
pkg.UpdateServerStats(int64(num))
server.BroadcastToRoom("/", "update", "updateLogs", msg)
default:
msg := fmt.Sprintf("Error: too many zip files in root: %v\n", zips)
@@ -194,6 +206,7 @@ func Unzip(srcZip, destDir string) error {
if err != nil {
return err
}
}
return nil