pgraph: Remove unnecessary indentation in Process code path

We can indent the simple BackPoke code path instead!
This commit is contained in:
James Shubin
2017-01-16 19:37:19 -05:00
parent 9ecc49e592
commit 8d2b53373f

View File

@@ -164,7 +164,12 @@ func (g *Graph) Process(v *Vertex) error {
// is it okay to run dependency wise right now? // is it okay to run dependency wise right now?
// if not, that's okay because when the dependency runs, it will poke // if not, that's okay because when the dependency runs, it will poke
// us back and we will run if needed then! // us back and we will run if needed then!
if g.OKTimestamp(v) { if !g.OKTimestamp(v) {
go g.BackPoke(v)
return nil
}
// timestamp must be okay...
if g.Flags.Debug { if g.Flags.Debug {
log.Printf("%s[%s]: OKTimestamp(%v)", obj.Kind(), obj.GetName(), v.GetTimestamp()) log.Printf("%s[%s]: OKTimestamp(%v)", obj.Kind(), obj.GetName(), v.GetTimestamp())
} }
@@ -285,10 +290,6 @@ func (g *Graph) Process(v *Vertex) error {
// poke at our pre-req's instead since they need to refresh/run... // poke at our pre-req's instead since they need to refresh/run...
return errwrap.Wrapf(err, "could not Process() successfully") return errwrap.Wrapf(err, "could not Process() successfully")
} }
// else... only poke at the pre-req's that need to run
go g.BackPoke(v)
return nil
}
// SentinelErr is a sentinal as an error type that wraps an arbitrary error. // SentinelErr is a sentinal as an error type that wraps an arbitrary error.
type SentinelErr struct { type SentinelErr struct {