From: Cameron Moore Date: Fri, 8 Jan 2021 16:26:35 +0000 (-0600) Subject: tpl: Fix metrics hint tracking X-Git-Tag: v0.81.0~59 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0004a733c85cee991a8a170e93cd69c326cc8f2f;p=brevno-suite%2Fhugo tpl: Fix metrics hint tracking When tracking for cache hints, track the same template name as the call to MeasureSince in Execute. When referencing a partial "foo", the value of `n` does not match `templ.Name()` (`partials/foo` versus `partials/foo.html`). This was causing hints to go untracked since there was no existing metric to append the hint to. Fixes #8125 --- diff --git a/tpl/partials/partials.go b/tpl/partials/partials.go index 016e0423..e8a8adc3 100644 --- a/tpl/partials/partials.go +++ b/tpl/partials/partials.go @@ -155,7 +155,7 @@ func (ns *Namespace) Include(name string, contextList ...interface{}) (interface } if ns.deps.Metrics != nil { - ns.deps.Metrics.TrackValue(n, result) + ns.deps.Metrics.TrackValue(templ.Name(), result) } return result, nil