Cleanup; Adding locks where needed, and checking port availibility
This commit is contained in:
11
instance.go
11
instance.go
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user