Browse Source

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

bigeagle 9 years ago
parent
commit
fa98e4f029
1 changed files with 2 additions and 1 deletions
  1. 2 1
      cmd/tunasync/tunasync.go

+ 2 - 1
cmd/tunasync/tunasync.go

@@ -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()
 			}