Skip restart from file changes when there is another restart going on

This commit is contained in:
Max Claus Nunes 2018-10-21 11:11:31 -03:00
parent a93d484fb3
commit a5cac98c13
1 changed files with 5 additions and 0 deletions

View File

@ -98,6 +98,11 @@ func run(cfg *Config, chOSSiginal chan os.Signal, builder Builder, runner Runner
select {
case event := <-watcher.Events():
logger.Debug("Detected new changed file:", event)
if changeRestart {
logger.Debug("Skip restart due to existing on going restart")
continue
}
changeRestart = true
if err := restart(builder, runner); err != nil {
return err