Skip to content

Commit

Permalink
app/config: load nats connect timeout from env var
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrebel committed Jun 1, 2023
1 parent e9636ad commit 5a5773e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ func (a *App) envVarNatsOverrides() error {
return errors.New("missing parameter: nats.consumer.filterSubject")
}

if a.v.GetDuration("nats.connect.timeout") != 0 {
a.Config.NatsOptions.ConnectTimeout = a.v.GetDuration("nats.connect.timeout")
}

if a.Config.NatsOptions.ConnectTimeout == 0 {
a.Config.NatsOptions.ConnectTimeout = defaultNatsConnectTimeout
}
Expand Down

0 comments on commit 5a5773e

Please sign in to comment.