1 Commits

Author SHA256 Message Date
af066c520c rabbitmq: dial with timeout
All checks were successful
go-generate-check / go-generate-check (pull_request) Successful in 21s
Integration tests / t (pull_request) Successful in 4m21s
Hardcoded 10 second timeout on no connection instead of waiting
forever.
2026-02-27 16:45:52 +01:00

View File

@@ -92,10 +92,13 @@ func ConnectToExchangeForPublish(host, username, password string) {
auth = username + ":" + password + "@"
}
connection, err := rabbitmq.DialTLS("amqps://"+auth+host, &tls.Config{
ServerName: host,
connection, err := rabbitmq.DialConfig("amqps://"+auth+host, rabbitmq.Config{
Dial: rabbitmq.DefaultDial(10 * time.Second),
TLSClientConfig: &tls.Config{
ServerName: host,
},
})
failOnError(err, "Cannot connect to rabbit.opensuse.org")
failOnError(err, "Cannot connect to "+host)
defer connection.Close()
ch, err := connection.Channel()