ashb commented on code in PR #64184:
URL: https://github.com/apache/airflow/pull/64184#discussion_r3000514655
##########
go-sdk/edge/worker.go:
##########
@@ -80,10 +81,23 @@ func Run(ctx context.Context) error {
return err
}
}
-
- w, err := NewWorker(hostname, apiURL,
viper.GetString("api_auth.secret_key"),
- viper.GetStringSlice("queues"),
- )
+ conf := config.WorkerConfig{
+ ApiURL: apiURL,
+ Hostname: hostname,
+ Issuer: "airflow",
+ Queues: viper.GetStringSlice("queues"),
+ ClientConfig: config.ClientConfig{
+ RetryCount: configOrDefault("edge.api_retries", 10),
+ StartWaitTime: time.Duration(
+ configOrDefault("edge.api_retry_wait_min", 1),
+ ) * time.Minute,
+ MaxWaitTime: time.Duration(
+ configOrDefault("edge.api_retry_wait_max", 90),
+ ) * time.Minute,
+ },
+ }
Review Comment:
We should use the Unmarshal capability built in to viper for this
https://github.com/spf13/viper?tab=readme-ov-file#unmarshaling
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]