mirror of
https://github.com/beego/bee.git
synced 2024-11-21 23:50:54 +00:00
Update watch.go
fix bug with reload static files before: on change static file bee reload web page on change go files bee only reload web page after: on change static file bee reload web page on change go files bee rebuild app without not reload web page.
This commit is contained in:
parent
c2161cac3f
commit
ee3dd8f436
6
watch.go
6
watch.go
@ -55,7 +55,7 @@ func NewWatcher(paths []string, files []string, isgenerate bool) {
|
||||
case e := <-watcher.Events:
|
||||
isBuild := true
|
||||
|
||||
if ifStaticFile(e.Name) || conf.EnableReload {
|
||||
if ifStaticFile(e.Name) && conf.EnableReload {
|
||||
sendReload(e.String())
|
||||
continue
|
||||
}
|
||||
@ -82,10 +82,6 @@ func NewWatcher(paths []string, files []string, isgenerate bool) {
|
||||
scheduleTime = time.Now().Add(1 * time.Second)
|
||||
time.Sleep(scheduleTime.Sub(time.Now()))
|
||||
AutoBuild(files, isgenerate)
|
||||
|
||||
if conf.EnableReload {
|
||||
sendReload(e.String())
|
||||
}
|
||||
}()
|
||||
}
|
||||
case err := <-watcher.Errors:
|
||||
|
Loading…
Reference in New Issue
Block a user