engine: GetSubsystemsStatus fix (#773)

* engine: GetSubsystemsStatus fix

* engine: force map literal to stop doubling up on keys, expanded test coverage

* engine: Deploy default for migration requirement.

* glorious: nits addr

* glorious: suggestion

* tests: fix
This commit is contained in:
Ryan O'Hara-Reid
2021-09-03 11:59:52 +10:00
committed by GitHub
parent a1a667bab9
commit a54c5107f4
12 changed files with 251 additions and 72 deletions

View File

@@ -15,6 +15,8 @@ const (
Name = "gctscript"
)
var ErrNilSubsystem = errors.New("gct script has not been set up")
// GctScriptManager loads and runs GCT Tengo scripts
type GctScriptManager struct {
config *Config
@@ -61,6 +63,9 @@ func (g *GctScriptManager) Start(wg *sync.WaitGroup) (err error) {
// Stop stops gctscript subsystem along with all running Virtual Machines
func (g *GctScriptManager) Stop() error {
if g == nil {
return fmt.Errorf("%s %w", caseName, ErrNilSubsystem)
}
if atomic.LoadInt32(&g.started) == 0 {
return fmt.Errorf("%s not running", caseName)
}