mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
Merge pull request #95 from Icinga/bugfix/wait-heartbeat
Wait for a new heartbeat
This commit is contained in:
commit
57972cc002
1 changed files with 4 additions and 1 deletions
|
|
@ -6,9 +6,12 @@ import (
|
|||
"crypto/sha1"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/Icinga/icingadb/connection"
|
||||
"github.com/Icinga/icingadb/utils"
|
||||
"github.com/go-redis/redis"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Environment struct {
|
||||
|
|
@ -35,7 +38,7 @@ func IcingaHeartbeatListener(rdb *connection.RDBWrapper, chEnv chan *Environment
|
|||
log.Info("Starting heartbeat listener")
|
||||
|
||||
xReadArgs := redis.XReadArgs{
|
||||
Streams: []string{"icinga:stats", "0-0"},
|
||||
Streams: []string{"icinga:stats", fmt.Sprintf("%d-0", utils.TimeToMillisecs(time.Now().Add(-15*time.Second)))},
|
||||
Count: 1,
|
||||
Block: 0,
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue