Skip to content

Commit 374e983

Browse files
committed
Merge pull request revel#848 from revel/feature/load-templates-onappstart
Fixes regression bug that caused templates not to trigger hot reload
2 parents f03faac + 132b9d1 commit 374e983

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

server.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,19 @@ func Run(port int) {
9090
MainTemplateLoader = NewTemplateLoader(TemplatePaths)
9191
MainTemplateLoader.Refresh()
9292

93-
// If desired (or by default), create a watcher for templates and routes.
94-
// The watcher calls Refresh() on things on the first request.
95-
if MainWatcher != nil && Config.BoolDefault("watch.templates", true) {
96-
MainWatcher.Listen(MainTemplateLoader, MainTemplateLoader.paths...)
97-
}
98-
9993
// The "watch" config variable can turn on and off all watching.
10094
// (As a convenient way to control it all together.)
10195
if Config.BoolDefault("watch", true) {
10296
MainWatcher = NewWatcher()
10397
Filters = append([]Filter{WatchFilter}, Filters...)
10498
}
10599

100+
// If desired (or by default), create a watcher for templates and routes.
101+
// The watcher calls Refresh() on things on the first request.
102+
if MainWatcher != nil && Config.BoolDefault("watch.templates", true) {
103+
MainWatcher.Listen(MainTemplateLoader, MainTemplateLoader.paths...)
104+
}
105+
106106
go func() {
107107
time.Sleep(100 * time.Millisecond)
108108
fmt.Printf("Listening on %s...\n", localAddress)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy