mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-10 00:10:56 +08:00
Adds django cache as monitor cache
Not the best solution yet, but it solves monitoring problems with brokers that don't have a pattern getter for cluster stats.
This commit is contained in:
@@ -26,14 +26,14 @@ class Redis(Broker):
|
||||
logger.error('Can not connect to Redis server.')
|
||||
raise e
|
||||
|
||||
def set(self, key, value, timeout):
|
||||
def set_stat(self, key, value, timeout):
|
||||
self.connection.set(key, value, timeout)
|
||||
|
||||
def get(self, key):
|
||||
def get_stat(self, key):
|
||||
if self.connection.exists(key):
|
||||
return self.connection.get(key)
|
||||
|
||||
def get_pattern(self, pattern):
|
||||
def get_stats(self, pattern):
|
||||
keys = self.connection.keys(pattern=pattern)
|
||||
if keys:
|
||||
return self.connection.mget(keys)
|
||||
|
||||
Reference in New Issue
Block a user