Skip to content

Commit

Permalink
fix #26
Browse files Browse the repository at this point in the history
  • Loading branch information
yanue committed Jun 17, 2021
1 parent fa21343 commit ee1e572
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gowatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,18 @@ func getFileModTime(path string) int64 {
return fi.ModTime().Unix()
}

var building bool

// Autobuild auto build
func Autobuild(files []string) {
if building {
log.Infof("still in building...\n")
return
}
building = true
defer func() {
building = false
}()
state.Lock()
defer state.Unlock()

Expand Down

0 comments on commit ee1e572

Please sign in to comment.