mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
check if AMQP host is set before attempting to connect
This commit is contained in:
parent
a37608c6e4
commit
eb10488c1f
1 changed files with 7 additions and 5 deletions
12
start.go
12
start.go
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue