fire perf counter after tmpl render

This commit is contained in:
Azareal 2020-02-24 11:18:54 +10:00
parent 0865dd4651
commit 75084fe452
1 changed files with 6 additions and 2 deletions

View File

@ -139,11 +139,15 @@ func renderTemplate3(tmplName, hookName string, w http.ResponseWriter, r *http.R
//if h.CurrentUser.IsAdmin {
h.Elapsed1 = since.String()
//}
co.PerfCounter.Push(since)
if c.RunPreRenderHook("pre_render_"+hookName, w, r, &h.CurrentUser, pi) {
return nil
}
return h.Theme.RunTmpl(tmplName, pi, w)
err := h.Theme.RunTmpl(tmplName, pi, w)
if err != nil {
return err
}
co.PerfCounter.Push(since)
return nil
}
// TODO: Rename renderTemplate to RenderTemplate instead of using this hack to avoid breaking things