Skip to content

Commit 9c5220e

Browse files
committed
ping db to remove supabase stale error
1 parent b4849ac commit 9c5220e

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/keep-alive.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ jobs:
1313
- name: Ping Supabase via backend
1414
run: |
1515
curl -sf --max-time 30 \
16-
"${{ secrets.BACKEND_URL }}/api/test-supabase" \
16+
"${{ secrets.BACKEND_URL }}/api/health?ping_db=true" \
1717
|| echo "Ping failed, but workflow won't block"

backend/Main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# main.py, entry point.
22

33
from datetime import timedelta
4-
from flask import Flask, jsonify
4+
from flask import Flask, jsonify, request
55
from flask_cors import CORS
66
from flask_jwt_extended import JWTManager
77
from dotenv import load_dotenv
@@ -33,6 +33,9 @@
3333

3434
@app.route("/api/health", methods=["GET"])
3535
def health():
36+
if request.args.get("ping_db"):
37+
from config import supabase
38+
supabase.from_("users").select("id").limit(1).execute()
3639
return jsonify({"status": "ok"})
3740

3841

0 commit comments

Comments
 (0)