You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the code below when __testRedis is called after __establishConnectionPool where an invalid host/port configuration is used only the 'now' time is printed, print x is never reached.
@staticmethod
def sleep(duration):
d = defer.Deferred()
reactor.callLater(duration, lambda *ign: d.callback(None))
return d
@defer.inlineCallbacks
def __establishConnectionPool(self, config):
redisConfig = config['redis']
self.redisConnection = yield txredisapi.lazyConnectionPool(host=redisConfig['host'], port=int(redisConfig['port']), reconnect=True)
@defer.inlineCallbacks
def __testRedis(self):
self.sleep(5)
try:
now = time.time()
print now
yield self.redisConnection.set('testme', now)
x = yield self.redisConnection.get('testme')
print x
if x != now:
raise Exception('Redis dead')
except Exception as e:
print "Exception: %s" % str(e)
finally:
try:
yield self.redisConnection.disconnect()
except Exception:
pass
The text was updated successfully, but these errors were encountered:
were you testing against master or the 1.2 release ? if master (or v1.3), the call would probably block on getConnection. see #68 . You might try the same test w/ reconnect=False
With the code below when __testRedis is called after __establishConnectionPool where an invalid host/port configuration is used only the 'now' time is printed, print x is never reached.
The text was updated successfully, but these errors were encountered: