Cambiar las conexiones oracle a pool

This commit is contained in:
2026-04-29 12:15:20 +02:00
parent 0b3dda43f9
commit f682652cd6
2 changed files with 50 additions and 24 deletions
+7 -4
View File
@@ -30,21 +30,24 @@ tema_styles = {
}
app = Flask(__name__)
init_pool()
def obtener_turnos(mon_id, qry):
conn = get_connection()
if not conn:
return []
conn = None
try:
conn = get_connection()
cursor = conn.cursor()
cursor.execute(qry,{'monitor':mon_id})
datos = cursor.fetchall()
cursor.close()
conn.close()
return datos
except Exception as e:
print(f"Error al conectar: {e}")
return None
finally:
if conn:
conn.close()
def obtener_pie(mon_id1, mon_id2):
conn = get_connection()