feat(app): stats added in to check if build in last build and also if theres a pending file
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user