-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
Hi there, i'm trying to use RQ worker to execute background jobs in my Torando App. I'm successful sofar, but one weird thing i noticed. Redis client creates a new connection everytime a job gets executed by the RQ worker. I found this issue by using the command redis-cli info | grep 'connection'. Everytime i check this command after a job gets executed, its incremented. To solve this problem i tried various implementations, but nothing worked. Below it he wrapper class i've created. It seems to be a bug in redis client, if i'm not wrong...Need help on this issue. Thanks in advance.
# Redis controller.
class Redis(object):
__Instance = None
def __init__(self):
if self.__class__.__Instance:
return
else:
self.__class__.__Instance = self
self.Conf = DBConf()['Redis']
print "NEW REDIS"
self.Engine = redis.Redis(connection_pool=redis.ConnectionPool(host=self.Conf['Host'],port=self.Conf['Port'],max_connections=10))
def __new__(self):
if self.__Instance:
return self.__Instance
else:
return object.__new__(self)Metadata
Metadata
Assignees
Labels
No labels