Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a721fcc

Browse filesBrowse files
committed
Fixes regression bug that caused templates not to trigger hot reload
1 parent 3b299ec commit a721fcc
Copy full SHA for a721fcc

File tree

1 file changed

+7
-6
lines changed
Filter options

1 file changed

+7
-6
lines changed

‎server.go

Copy file name to clipboardExpand all lines: server.go
+7-6Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,20 @@ 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+
WARN.Println("watch templates true")
104+
MainWatcher.Listen(MainTemplateLoader, MainTemplateLoader.paths...)
105+
}
106+
106107
go func() {
107108
time.Sleep(100 * time.Millisecond)
108109
fmt.Printf("Listening on %s...\n", localAddress)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.