[nominatim-web] Add proper healthcheck
- From: Bartłomiej Piotrowski <bpiotrowski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nominatim-web] Add proper healthcheck
- Date: Fri, 2 Jul 2021 11:22:54 +0000 (UTC)
commit 84fcee5daa7e17decf4048aef923a55513ed21c3
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date: Fri Jul 2 13:22:40 2021 +0200
Add proper healthcheck
app/main.py | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/app/main.py b/app/main.py
index 0601f70..0d0a330 100644
--- a/app/main.py
+++ b/app/main.py
@@ -43,6 +43,16 @@ def initialize():
@app.get("/status")
def healthcheck():
+ with postgres.cursor() as cur:
+ cur.execute("SELECT 1")
+ cur.fetchone()
+
+ with postgres_ro.cursor() as cur:
+ cur.execute("SELECT 1")
+ cur.fetchone()
+
+ redis_conn.ping()
+
return {"status": "OK"}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]