Skip to content

Commit

Permalink
Fix health view #1107 (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeauchesne authored Jun 16, 2021
1 parent cc01fe7 commit feb7cc7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion c2corg_api/tests/views/test_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ def setUp(self): # noqa
super(TestHealthRest, self).setUp()

def test_get(self):
self.app.get('/health', status=200)
r = self.app.get('/health', status=200)

data = r.json

self.assertEqual(data["es"], "ok")
self.assertEqual(data["redis"], "ok")
2 changes: 1 addition & 1 deletion c2corg_api/views/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _add_redis_status(self, status):
success = False

try:
client = cache_document_detail.backend.client
client = cache_document_detail.backend.writer_client
redis_keys = client.dbsize()
success = True
except Exception:
Expand Down

0 comments on commit feb7cc7

Please sign in to comment.