From 69a4f11718dcfbff7961f6ca183f7d4c477b5f29 Mon Sep 17 00:00:00 2001 From: Gerasimos Maropoulos Date: Tue, 19 Jul 2016 08:48:57 +0300 Subject: [PATCH] Fix https://github.com/kataras/iris/issues/303 --- iris.go | 3 +-- template.go | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iris.go b/iris.go index bf62a786..01f8c6df 100644 --- a/iris.go +++ b/iris.go @@ -262,6 +262,7 @@ func (s *Framework) initialize() { // prepare the templates if enabled if !s.Config.DisableTemplateEngines { + s.templates.reload = s.Config.IsDevelopment // check and prepare the templates if len(s.templates.engines) == 0 { // no template engine is registered, let's use the default s.UseTemplate(html.New()) @@ -270,8 +271,6 @@ func (s *Framework) initialize() { if err := s.templates.loadAll(); err != nil { s.Logger.Panic(err) // panic on templates loading before listening if we have an error. } - - s.templates.reload = s.Config.IsDevelopment } // listen to websocket connections diff --git a/template.go b/template.go index cd531e0a..4d974adf 100644 --- a/template.go +++ b/template.go @@ -276,6 +276,8 @@ func (t *templateEngines) loadAll() error { e.location.extension = DefaultTemplateExtension // the default file ext .html } + e.reload = t.reload // update the configuration every time a load happens + if err := e.load(); err != nil { return err }