fix(shell): lock template cache creation

This commit is contained in:
Jan De Dobbeleer 2022-12-27 14:31:11 +01:00 committed by Jan De Dobbeleer
parent 2f1bf39253
commit 73e91eab5b

View file

@ -708,6 +708,8 @@ func (env *Shell) Logs() string {
}
func (env *Shell) TemplateCache() *TemplateCache {
lock.Lock()
defer lock.Unlock()
defer env.Trace(time.Now(), "TemplateCache")
if env.tmplCache != nil {
return env.tmplCache