Skip to content

Commit

Permalink
fix: applied better fix for PR #46
Browse files Browse the repository at this point in the history
  • Loading branch information
skaurus committed Aug 1, 2022
1 parent 2b26a7e commit 0d55328
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions goworker.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ type WorkerSettings struct {
}

func SetSettings(settings WorkerSettings) {
// force the flags to be parsed first before setting the configs.
_ = Init()
// force the flags to be parsed first before setting the configs, so
// they won't overwrite the settings
if err := flags(); err != nil {
panic(fmt.Errorf("can't SetSettings because of %w", err))
}
workerSettings = settings
}

Expand Down

0 comments on commit 0d55328

Please sign in to comment.