When playground is created or modified it emits an event. (#225)
The scheduler listens to playground events and updates it's configuration immediately.
This commit is contained in:
committed by
Marcos Nils
parent
65b8364ef2
commit
d758c1a303
@@ -3,6 +3,7 @@ package pwd
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/play-with-docker/play-with-docker/event"
|
||||
"github.com/play-with-docker/play-with-docker/pwd/types"
|
||||
"github.com/satori/go.uuid"
|
||||
)
|
||||
@@ -14,6 +15,7 @@ func (p *pwd) PlaygroundNew(playground types.Playground) (*types.Playground, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
p.event.Emit(event.PLAYGROUND_NEW, playground.Id)
|
||||
return &playground, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user