Skip to content

Commit

Permalink
Fix thread blocking backups
Browse files Browse the repository at this point in the history
  • Loading branch information
lululombard committed Jun 30, 2023
1 parent 576e1c5 commit 5c84f98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion rcsm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

var (
// Version is the current version of rcsm
Version string = "1.1.3"
Version string = "1.1.4"
// EnvFile is the path to the .env file config
EnvFile string = ".env"

Expand Down
9 changes: 2 additions & 7 deletions rcsm/servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,16 @@ func BackupServer(serverName string) {

// Acquire lock on minecraftServers
minecraftServersLock.Lock()
defer minecraftServersLock.Unlock()
server := minecraftServers[serverName]
minecraftServersLock.Unlock()

TriggerLogEvent("info", serverName, "Backing up server")

server := minecraftServers[serverName]

backupServer(server)
}

// BackupAllServers backups all servers
func BackupAllServers() {
// Acquire lock on minecraftServers
minecraftServersLock.Lock()
defer minecraftServersLock.Unlock()

TriggerLogEvent("info", "rcsm", fmt.Sprintf("Backing up all servers"))
for _, server := range minecraftServers {
backupServer(server)
Expand Down
2 changes: 1 addition & 1 deletion rcsm/tmux.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func SessionCreate(serverName string, fullPath string, startCommand string) (str
return "", err
}

if WaitForSessionState(serverName, true, time.Second) != nil {
if WaitForSessionState(serverName, true, 15*time.Second) != nil {
return "", fmt.Errorf("Server crashed on start, check server logs")
}

Expand Down

0 comments on commit 5c84f98

Please sign in to comment.