lib, gapi: Next method of GAPI should generate first event
This puts the generation of the initial event into the Next method of the GAPI. If it does not happen, then we will never get a graph. This is important because this notifies the GAPI when we're actually ready to try and generate a graph, rather than blocking on the Graph method if we have a long compile for example. This is also required for the etcd watch cleanup.
This commit is contained in:
@@ -74,9 +74,6 @@ func (obj *MyGAPI) Graph() (*pgraph.Graph, error) {
|
||||
|
||||
// Next returns nil errors every time there could be a new graph.
|
||||
func (obj *MyGAPI) Next() chan error {
|
||||
if obj.data.NoWatch || obj.Interval <= 0 {
|
||||
return nil
|
||||
}
|
||||
ch := make(chan error)
|
||||
obj.wg.Add(1)
|
||||
go func() {
|
||||
|
||||
Reference in New Issue
Block a user