Spaces:
Running
Running
Update helper/subscriptions.py
Browse files- helper/subscriptions.py +3 -5
helper/subscriptions.py
CHANGED
|
@@ -117,17 +117,15 @@ SUPABASE_KEY = os.getenv("SUPABASE_SERVICE_ROLE_KEY")
|
|
| 117 |
supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY)
|
| 118 |
POSTGRE_SECRET = os.getenv("POSTGRE_SECRET")
|
| 119 |
|
| 120 |
-
conn = await psycopg.AsyncConnection.connect(POSTGRE_SECRET, row_factory=dict_row, sslmode="verify-full", sslrootcert="prod-ca-2021.crt")
|
| 121 |
-
|
| 122 |
-
|
| 123 |
async def get_conn():
|
| 124 |
global conn
|
| 125 |
|
| 126 |
if conn is None or conn.closed:
|
| 127 |
-
|
| 128 |
|
| 129 |
return conn
|
| 130 |
-
|
|
|
|
| 131 |
|
| 132 |
import psycopg
|
| 133 |
from psycopg.rows import dict_row
|
|
|
|
| 117 |
supabase: Client = create_client(SUPABASE_URL, SUPABASE_KEY)
|
| 118 |
POSTGRE_SECRET = os.getenv("POSTGRE_SECRET")
|
| 119 |
|
|
|
|
|
|
|
|
|
|
| 120 |
async def get_conn():
|
| 121 |
global conn
|
| 122 |
|
| 123 |
if conn is None or conn.closed:
|
| 124 |
+
conn = await psycopg.AsyncConnection.connect(POSTGRE_SECRET, row_factory=dict_row, sslmode="verify-full", sslrootcert="prod-ca-2021.crt")
|
| 125 |
|
| 126 |
return conn
|
| 127 |
+
|
| 128 |
+
conn = await get_conn()
|
| 129 |
|
| 130 |
import psycopg
|
| 131 |
from psycopg.rows import dict_row
|