fix valueerror

This commit is contained in:
Cyberes 2023-12-19 23:30:54 -07:00
parent 445d4e274c
commit 0300fdd75e
2 changed files with 7 additions and 4 deletions

View File

@ -76,8 +76,11 @@ class OpnsenseTraffic:
keys = self.redis.keys() keys = self.redis.keys()
data = {} data = {}
for key in keys: for key in keys:
print(key.decode()) try:
interface, address = key.decode().split(":") interface, address = key.decode().split(":")
except ValueError:
# Can get things like "opt2:::"
continue
if address != input_address: if address != input_address:
continue continue
entries = self.redis.lrange(key, 0, -1) entries = self.redis.lrange(key, 0, -1)
@ -256,4 +259,4 @@ if __name__ == '__main__':
time.sleep(10000) time.sleep(10000)
else: else:
app.run(debug=True) app.run(host='0.0.0.0', debug=True)

View File

@ -1,5 +1,5 @@
prometheus_client prometheus_client
requests~=2.28.2 requests~=2.31.0
numpy~=1.24.2 numpy~=1.24.2
matrix-nio matrix-nio
Pillow~=9.4.0 Pillow~=9.4.0