resources: Remove SetWatching/IsWatching code from Watch
This removes some boilerplate from the Watch methods which can be baked into the engine instead. This code should be checked for races and locks to make sure we only start resources when it makes sense to.
This commit is contained in:
@@ -289,6 +289,9 @@ func (g *Graph) Worker(v *Vertex) error {
|
||||
// the Watch() function about which graph it is
|
||||
// running on, which isolates things nicely...
|
||||
obj := v.Res
|
||||
// TODO: is there a better system for the `Watching` flag?
|
||||
obj.SetWatching(true)
|
||||
defer obj.SetWatching(false)
|
||||
processChan := make(chan event.Event)
|
||||
go func() {
|
||||
running := false
|
||||
|
||||
Reference in New Issue
Block a user