Fix go-for-loop reference bug in template caching.
This commit is contained in:
parent
d2e8a9368c
commit
281c47198c
1 changed files with 4 additions and 3 deletions
|
@ -439,11 +439,12 @@ func initTxTemplates(m *manager.Manager, app *App) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, t := range tpls {
|
for _, t := range tpls {
|
||||||
if err := t.Compile(app.manager.GenericTemplateFuncs()); err != nil {
|
tpl := t
|
||||||
lo.Printf("error compiling transactional template %d: %v", t.ID, err)
|
if err := tpl.Compile(app.manager.GenericTemplateFuncs()); err != nil {
|
||||||
|
lo.Printf("error compiling transactional template %d: %v", tpl.ID, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
m.CacheTpl(t.ID, &t)
|
m.CacheTpl(tpl.ID, &tpl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue