From a7e3cdc77c262a0e42773197cb67f7a0f04c900b Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Sun, 29 Dec 2013 11:17:34 +0100 Subject: [PATCH] Less redis queries a bit more memory usage --- bin/qof-server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/qof-server.py b/bin/qof-server.py index ef88cda..2014d66 100644 --- a/bin/qof-server.py +++ b/bin/qof-server.py @@ -60,9 +60,10 @@ def getRecord(t = None): for rr in rrset: if (rr['Value']) is not None and rr['Value'] in rrset_supported: rec = "r:"+t+":"+rr['Value'] - if r.smembers(rec): + rs = r.smembers(rec) + if rs: rrval = {} - for v in r.smembers(rec): + for v in rs: rdata = v.decode(encoding='UTF-8').strip() rrval['time_first'] = getFirstSeen(t1=t, t2=rdata) rrval['time_last'] = getLastSeen(t1=t, t2=rdata)