summaryrefslogtreecommitdiffstats
path: root/tpl/partials
diff options
context:
space:
mode:
authorCameron Moore <moorereason@gmail.com>2021-01-08 10:26:35 -0600
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-01-08 20:01:11 +0100
commit0004a733c85cee991a8a170e93cd69c326cc8f2f (patch)
tree3556fc9533bfd1ce705da0e0e4fd04aac8288e34 /tpl/partials
parent8a26ab0bc5dd9fa34e1362681fc08b0e522cd4ea (diff)
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
Diffstat (limited to 'tpl/partials')
-rw-r--r--tpl/partials/partials.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/tpl/partials/partials.go b/tpl/partials/partials.go
index 016e0423c..e8a8adc36 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