mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
Move environemtn to HA
This commit is contained in:
parent
6141ec4f14
commit
d08c7750aa
1 changed files with 6 additions and 12 deletions
18
redis.go
18
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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue