From 121cb12487f33bcf5fe82ef34b8d15f007ca0bee Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sat, 6 Feb 2021 01:59:25 +0100 Subject: [PATCH] amqp: do not send periodical pings anymore --- .../infrastructure-component/ic_amqpclient.go | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/routes/infrastructure-component/ic_amqpclient.go b/routes/infrastructure-component/ic_amqpclient.go index 13d73c0..11c6d2a 100644 --- a/routes/infrastructure-component/ic_amqpclient.go +++ b/routes/infrastructure-component/ic_amqpclient.go @@ -24,13 +24,14 @@ package infrastructure_component import ( "encoding/json" "fmt" + "log" + "time" + "github.com/gin-gonic/gin" "github.com/google/uuid" "github.com/jinzhu/gorm" "github.com/jinzhu/gorm/dialects/postgres" "github.com/streadway/amqp" - "log" - "time" ) const VILLAS_EXCHANGE = "villas" @@ -239,25 +240,6 @@ func StartAMQP(AMQPurl string, api *gin.RouterGroup) error { // register IC action endpoint only if AMQP client is used RegisterAMQPEndpoint(api.Group("/ic")) - // Periodically call the Ping function to check which ICs are still there - ticker := time.NewTicker(10 * time.Second) - go func() { - - for { - select { - case <-ticker.C: - //TODO Add a useful regular event here - /* - err = PingAMQP() - if err != nil { - log.Println("AMQP Error: ", err.Error()) - } - */ - } - } - - }() - log.Printf("Connected AMQP client to %s", AMQPurl) }