[Netfilter] Wait for Redis instead of exiting with an exception
parent
5cb8df3f11
commit
240eb3abce
|
@ -14,7 +14,16 @@ import time
|
||||||
import json
|
import json
|
||||||
import iptc
|
import iptc
|
||||||
|
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
r = redis.StrictRedis(host=os.getenv('IPV4_NETWORK', '172.22.1') + '.249', decode_responses=True, port=6379, db=0)
|
r = redis.StrictRedis(host=os.getenv('IPV4_NETWORK', '172.22.1') + '.249', decode_responses=True, port=6379, db=0)
|
||||||
|
r.ping()
|
||||||
|
except Exception as ex:
|
||||||
|
print '%s - trying again in 3 seconds' % (ex)
|
||||||
|
time.sleep(3)
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
pubsub = r.pubsub()
|
pubsub = r.pubsub()
|
||||||
|
|
||||||
RULES = {}
|
RULES = {}
|
||||||
|
|
Loading…
Reference in New Issue