mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
amqp: do not send periodical pings anymore
This commit is contained in:
parent
6a5379c9b5
commit
121cb12487
1 changed files with 3 additions and 21 deletions
|
@ -24,13 +24,14 @@ package infrastructure_component
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/jinzhu/gorm"
|
"github.com/jinzhu/gorm"
|
||||||
"github.com/jinzhu/gorm/dialects/postgres"
|
"github.com/jinzhu/gorm/dialects/postgres"
|
||||||
"github.com/streadway/amqp"
|
"github.com/streadway/amqp"
|
||||||
"log"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const VILLAS_EXCHANGE = "villas"
|
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
|
// register IC action endpoint only if AMQP client is used
|
||||||
RegisterAMQPEndpoint(api.Group("/ic"))
|
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)
|
log.Printf("Connected AMQP client to %s", AMQPurl)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue