From d08c7750aa0862194a7342248adf2bafaba5bdf8 Mon Sep 17 00:00:00 2001 From: Jean Flach Date: Thu, 7 Mar 2019 17:19:31 +0100 Subject: [PATCH] Move environemtn to HA --- redis.go | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/redis.go b/redis.go index 4421c816..22943c4d 100644 --- a/redis.go +++ b/redis.go @@ -9,11 +9,6 @@ import ( "time" ) -type Environment struct { - ID []byte - Name string -} - type Icinga2RedisWriterEventsConfig struct { Update, Delete, Dump string } @@ -74,15 +69,14 @@ type RedisClient interface { } type StatusCmd interface { - } // Redis wrapper including helper functions type RDBWrapper struct { - Rdb RedisClient - ConnectedAtomic *uint32 //uint32 to be able to use atomic operations - ConnectionUpCondition *sync.Cond - ConnectionLostCounterAtomic *uint32 //uint32 to be able to use atomic operations + Rdb RedisClient + ConnectedAtomic *uint32 //uint32 to be able to use atomic operations + ConnectionUpCondition *sync.Cond + ConnectionLostCounterAtomic *uint32 //uint32 to be able to use atomic operations } func (rdbw *RDBWrapper) IsConnected() bool { @@ -108,7 +102,7 @@ func NewRDBWrapper(address string) (*RDBWrapper, error) { rdbw := RDBWrapper{ Rdb: rdb, ConnectedAtomic: new(uint32), ConnectionLostCounterAtomic: new(uint32), - ConnectionUpCondition: sync.NewCond(&sync.Mutex{}), + ConnectionUpCondition: sync.NewCond(&sync.Mutex{}), } _, err := rdbw.Rdb.Ping().Result() @@ -331,4 +325,4 @@ func (rdbw *RDBWrapper) Subscribe() PubSubWrapper { ps := rdbw.Rdb.Subscribe() psw := PubSubWrapper{ps: ps, rdbw: rdbw} return psw -} \ No newline at end of file +}