|
@@ -4,7 +4,7 @@ from redistimeseries.client import Client as RedisTimeSeries
|
|
|
import redis
|
|
|
import time
|
|
|
|
|
|
-redis_host = "localhost"
|
|
|
+redis_host = "redis"
|
|
|
redis_port = 6379
|
|
|
|
|
|
rts = RedisTimeSeries(host=redis_host, port=redis_port)
|
|
@@ -21,7 +21,14 @@ except:
|
|
|
print("group already exists")
|
|
|
|
|
|
while True:
|
|
|
- msgs = r.xreadgroup("consumerGroup", "consumerName", streams={"mystream": '>'}, count=10, block=1000, noack=False)
|
|
|
+ # Retry
|
|
|
+ try:
|
|
|
+ msgs = r.xreadgroup("consumerGroup", "consumerName", streams={"mystream": '>'}, count=10, block=1000, noack=False)
|
|
|
+ except:
|
|
|
+ print("Could not create readgroup")
|
|
|
+ time.sleep(5)
|
|
|
+ continue
|
|
|
+
|
|
|
for msg in msgs:
|
|
|
for m in msg[1]:
|
|
|
evnt = m[1]['event_type']
|