Server state handling; auto start servers if they were running when the daemon stopped

This commit is contained in:
Dane Everitt
2019-11-24 21:31:31 -08:00
parent 47c7c872fc
commit 85762ba4b9
2 changed files with 59 additions and 18 deletions

View File

@@ -29,7 +29,7 @@ type Server struct {
Suspended bool `json:"suspended"`
// The power state of the server.
State string `json:"state" yaml:"-"`
State string `default:"offline" json:"state"`
// The command that should be used when booting up the server instance.
Invocation string `json:"invocation"`
@@ -224,7 +224,6 @@ func FromConfiguration(data []byte, cfg *config.SystemConfiguration) (*Server, e
return nil, err
}
s.State = ProcessOfflineState
s.Environment = env
s.Cache = cache.New(time.Minute*10, time.Minute*15)
s.Filesystem = &Filesystem{