Commit ac81d393 authored by ale's avatar ale
Browse files

ignore None values in hmget() result

parent d39fcc70
......@@ -62,8 +62,10 @@ class Accounting(object):
while True:
old_values = [json.loads(x) for x in pipe.hmget(aggr_key, days)]
old_aggr = dict(zip(days, old_values))
old_aggr = {}
for day, data in zip(days, pipe.hmget(aggr_key, days)):
if data:
old_aggr[day] = json.loads(data)
for day, aggr_data in aggr.iteritems():
old_aggr_data = old_aggr.get(day, {})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment