mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
add monitor route for redis_pubsub
This commit is contained in:
parent
92d8caf2b4
commit
878b531927
1 changed files with 16 additions and 0 deletions
|
@ -102,6 +102,22 @@ def db_check_redis_story():
|
|||
else:
|
||||
abort(404)
|
||||
|
||||
@app.route("/db_check/redis_pubsub")
|
||||
def db_check_redis_story():
|
||||
redis_host = getattr(settings, 'REDIS', {'host': 'db_redis_pubsub'})
|
||||
try:
|
||||
r = redis.Redis(redis_host['host'], db=1)
|
||||
except:
|
||||
abort(502)
|
||||
|
||||
pubsub_numpat = r.pubsub_numpat()
|
||||
if pubsub_numpat:
|
||||
return str(pubsub_numpat)
|
||||
else:
|
||||
abort(404)
|
||||
|
||||
|
||||
|
||||
@app.route("/db_check/redis_sessions")
|
||||
def db_check_redis_sessions():
|
||||
redis_host = getattr(settings, 'REDIS', {'host': 'db_redis_sessions'})
|
||||
|
|
Loading…
Add table
Reference in a new issue