mirror of
https://github.com/beego/bee.git
synced 2024-11-22 05:00:54 +00:00
commit
268a9d8346
10
watch.go
10
watch.go
@ -66,15 +66,9 @@ func NewWatcher(paths []string, files []string, isgenerate bool) {
|
|||||||
if isbuild {
|
if isbuild {
|
||||||
logger.Infof("Event fired: %s", e)
|
logger.Infof("Event fired: %s", e)
|
||||||
go func() {
|
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)
|
scheduleTime = time.Now().Add(1 * time.Second)
|
||||||
for {
|
time.Sleep(scheduleTime.Sub(time.Now()))
|
||||||
time.Sleep(scheduleTime.Sub(time.Now()))
|
|
||||||
if time.Now().After(scheduleTime) {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
AutoBuild(files, isgenerate)
|
AutoBuild(files, isgenerate)
|
||||||
|
|
||||||
if conf.EnableReload {
|
if conf.EnableReload {
|
||||||
|
Loading…
Reference in New Issue
Block a user