Skip to content

Commit

Permalink
Move RedisClient QUIT command to separate callback.
Browse files Browse the repository at this point in the history
  • Loading branch information
isislovecruft committed Aug 28, 2014
1 parent e2a609a commit b0f96b9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/bridgedb/database/redis.py
Expand Up @@ -237,9 +237,7 @@ def transactionsResults(results):
logging.info("REDIS: %d successful transactions, %d failed"
% (okay, len(fails)))
[logging.warn("REDIS: %r" % repr(fail)) for fail in fails]
logging.debug("REDIS: QUIT %s" % hash(redis))
d = redis.quit()
return d
return redis

def redisCB(redis, transactions):
"""Callback every waiting database transaction in the ``DeferredList``
Expand All @@ -253,6 +251,12 @@ def redisCB(redis, transactions):
[d.callback(redis) for d in transactions]
return redis

def doQuit(redis):
logging.debug("REDIS: QUIT %s" % hash(redis))
if redis.connected and not redis._disconnected:
d = redis.quit()
return d

transactions = []
for router in routers.items():
d = defer.Deferred()
Expand Down

0 comments on commit b0f96b9

Please sign in to comment.