check if AMQP host is set before attempting to connect

This commit is contained in:
Sonja Happ 2020-03-20 15:33:16 +01:00
parent a37608c6e4
commit eb10488c1f

View file

@ -208,11 +208,13 @@ func main() {
panic(err)
}
// create amqp URL based on username, password and host
amqpurl := "amqp://" + amqpuser + ":" + amqppass + "@" + amqphost
err = connectAMQP(amqpurl, api)
if err != nil {
panic(err)
if amqphost != "" {
// create amqp URL based on username, password and host
amqpurl := "amqp://" + amqpuser + ":" + amqppass + "@" + amqphost
err = connectAMQP(amqpurl, api)
if err != nil {
panic(err)
}
}
// server at port 4000 to match frontend's redirect path