fix(worker): do not reload if config has errors

This commit is contained in:
bigeagle 2016-05-19 11:35:53 +08:00
parent 3762e7a1a5
commit fa98e4f029

View File

@ -70,8 +70,9 @@ func startWorker(c *cli.Context) {
newCfg, err := worker.LoadConfig(c.String("config"))
if err != nil {
logger.Errorf("Error loading config: %s", err.Error())
} else {
w.ReloadMirrorConfig(newCfg.Mirrors)
}
w.ReloadMirrorConfig(newCfg.Mirrors)
case syscall.SIGINT, syscall.SIGTERM:
w.Halt()
}