Skip to content

Commit

Permalink
fix: log starting a worker after exclusion check
Browse files Browse the repository at this point in the history
Only log "starting worker" if the worker is not excluded.

Signed-off-by: Link Dupont <[email protected]>
  • Loading branch information
subpop committed Jan 25, 2022
1 parent 2833a7b commit 1e7e5a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/yggd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ func main() {
return cli.Exit(fmt.Errorf("cannot read contents of directory: %w", err), 1)
}
for _, info := range fileInfos {
log.Debugf("starting worker: %v", info.Name())
config, err := loadWorkerConfig(filepath.Join(workerPath, info.Name()))
if err != nil {
log.Errorf("cannot load worker config: %v", err)
Expand All @@ -343,6 +342,7 @@ func main() {
if ExcludeWorkers[config.directive] {
continue
}
log.Debugf("starting worker: %v", config.directive)
go func() {
if err := startWorker(*config, nil, func(pid int) {
d.deadWorkers <- pid
Expand Down
1 change: 1 addition & 0 deletions cmd/yggd/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ func watchWorkerDir(dir string, died chan int) {
if ExcludeWorkers[config.directive] {
continue
}
log.Debugf("starting worker: %v", config.directive)
go func() {
if err := startWorker(*config, nil, func(pid int) {
died <- pid
Expand Down

0 comments on commit 1e7e5a9

Please sign in to comment.