Fehlerbehandlung in fastd2redis korrigiert
parent
ffbb2ae31d
commit
88cfca048f
|
@ -12,6 +12,8 @@ import subprocess
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from rediscluster import StrictRedisCluster
|
from rediscluster import StrictRedisCluster
|
||||||
|
from rediscluster.exceptions import ClusterDownError
|
||||||
|
from redis.exceptions import ConnectionError
|
||||||
|
|
||||||
def get_gate_nodeid():
|
def get_gate_nodeid():
|
||||||
# Die ID kann statisch angegeben werden, falls das nicht
|
# Die ID kann statisch angegeben werden, falls das nicht
|
||||||
|
@ -50,9 +52,12 @@ def main(rc):
|
||||||
except IndexError:
|
except IndexError:
|
||||||
continue
|
continue
|
||||||
rckey = "fastd:tunnel:%s" % tunnel_id
|
rckey = "fastd:tunnel:%s" % tunnel_id
|
||||||
rc.hset(rckey, 'key', key)
|
try:
|
||||||
rc.hset(rckey, 'last_seen', now)
|
rc.hset(rckey, 'key', key)
|
||||||
rc.hset(rckey, 'last_gate', gate_id)
|
rc.hset(rckey, 'last_seen', now)
|
||||||
|
rc.hset(rckey, 'last_gate', gate_id)
|
||||||
|
except ClusterDownError:
|
||||||
|
pass
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
startup_nodes = [{"host": "127.0.0.1", "port": "7000"}]
|
startup_nodes = [{"host": "127.0.0.1", "port": "7000"}]
|
||||||
|
|
Loading…
Reference in New Issue