1
0
mirror of https://github.com/beego/bee.git synced 2024-12-22 15:10:49 +00:00

Merge pull request #352 from ogero/develop

Fixes #351
This commit is contained in:
astaxie 2017-02-13 12:34:04 +08:00 committed by GitHub
commit 268a9d8346

View File

@ -66,15 +66,9 @@ func NewWatcher(paths []string, files []string, isgenerate bool) {
if isbuild {
logger.Infof("Event fired: %s", e)
go func() {
// Wait 1s before autobuild util there is no file change.
// Wait 1s before autobuild until there is no file change.
scheduleTime = time.Now().Add(1 * time.Second)
for {
time.Sleep(scheduleTime.Sub(time.Now()))
if time.Now().After(scheduleTime) {
break
}
return
}
time.Sleep(scheduleTime.Sub(time.Now()))
AutoBuild(files, isgenerate)
if conf.EnableReload {