Spaces:
Running
Running
sync: 193 file da Baida98/AI@5acba2e8 (2026-08-28 05:56 UTC) [deploy-all]
#127
by Baida07 - opened
- api/performance_rum.py +7 -1
api/performance_rum.py
CHANGED
|
@@ -126,7 +126,13 @@ def _execute(sql: str, params: dict[str, Any], *, fetch: bool = False) -> list[d
|
|
| 126 |
import psycopg2
|
| 127 |
import psycopg2.extras
|
| 128 |
|
| 129 |
-
conn = psycopg2.connect(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
try:
|
| 131 |
with conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor) as cur:
|
| 132 |
cur.execute("SET statement_timeout = '5000ms'")
|
|
|
|
| 126 |
import psycopg2
|
| 127 |
import psycopg2.extras
|
| 128 |
|
| 129 |
+
conn = psycopg2.connect(
|
| 130 |
+
_db_url(),
|
| 131 |
+
connect_timeout=5,
|
| 132 |
+
sslmode="require",
|
| 133 |
+
application_name="baida-rum",
|
| 134 |
+
options="-c statement_timeout=5000",
|
| 135 |
+
)
|
| 136 |
try:
|
| 137 |
with conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor) as cur:
|
| 138 |
cur.execute("SET statement_timeout = '5000ms'")
|