Less redis queries a bit more memory usage

This commit is contained in:
Alexandre Dulaunoy 2013-12-29 11:17:34 +01:00
parent a9b8d0e9f4
commit a7e3cdc77c

View file

@ -60,9 +60,10 @@ def getRecord(t = None):
for rr in rrset: for rr in rrset:
if (rr['Value']) is not None and rr['Value'] in rrset_supported: if (rr['Value']) is not None and rr['Value'] in rrset_supported:
rec = "r:"+t+":"+rr['Value'] rec = "r:"+t+":"+rr['Value']
if r.smembers(rec): rs = r.smembers(rec)
if rs:
rrval = {} rrval = {}
for v in r.smembers(rec): for v in rs:
rdata = v.decode(encoding='UTF-8').strip() rdata = v.decode(encoding='UTF-8').strip()
rrval['time_first'] = getFirstSeen(t1=t, t2=rdata) rrval['time_first'] = getFirstSeen(t1=t, t2=rdata)
rrval['time_last'] = getLastSeen(t1=t, t2=rdata) rrval['time_last'] = getLastSeen(t1=t, t2=rdata)