Spaces:
Running
Running
Update helper/subscriptions.py
Browse files- helper/subscriptions.py +1 -2
helper/subscriptions.py
CHANGED
|
@@ -151,7 +151,7 @@ async def execute_query(query: str, params=(), *, fetchone=False, commit=False):
|
|
| 151 |
return result
|
| 152 |
|
| 153 |
except psycopg.OperationalError:
|
| 154 |
-
# reconnect
|
| 155 |
conn = await psycopg.AsyncConnection.connect(
|
| 156 |
POSTGRE_SECRET,
|
| 157 |
row_factory=dict_row,
|
|
@@ -177,7 +177,6 @@ async def execute_query(query: str, params=(), *, fetchone=False, commit=False):
|
|
| 177 |
await conn.rollback()
|
| 178 |
raise e
|
| 179 |
|
| 180 |
-
|
| 181 |
def normalize_plan_key(plan_name: str | None) -> str:
|
| 182 |
if not plan_name:
|
| 183 |
return "free"
|
|
|
|
| 151 |
return result
|
| 152 |
|
| 153 |
except psycopg.OperationalError:
|
| 154 |
+
# reconnect using ASYNC connection
|
| 155 |
conn = await psycopg.AsyncConnection.connect(
|
| 156 |
POSTGRE_SECRET,
|
| 157 |
row_factory=dict_row,
|
|
|
|
| 177 |
await conn.rollback()
|
| 178 |
raise e
|
| 179 |
|
|
|
|
| 180 |
def normalize_plan_key(plan_name: str | None) -> str:
|
| 181 |
if not plan_name:
|
| 182 |
return "free"
|