Cleanup; Adding locks where needed, and checking port availibility

This commit is contained in:
2026-06-06 15:48:43 -05:00
parent 9f4e27869b
commit 3a01e835a1
2 changed files with 48 additions and 12 deletions

View File

@@ -3,7 +3,6 @@ package main
import (
"fmt"
"os"
"os/exec"
"path/filepath"
)
@@ -14,16 +13,6 @@ const (
StateRunning InstanceState = "RUNNING"
)
type ManagedInstance struct {
Name string `json:"name"`
Version string `json:"version"`
Port int `json:"port"`
Status InstanceState `json:"status"`
Cmd *exec.Cmd `json:"-"`
Stdin interface{} `json:"-"`
}
func CreateNewInstance(name string, version string, options VsServerConfigOptions, cfg *AppConfig) error {
instanceDir := filepath.Join(cfg.Storage.InstancesDir, name)