Cambiar las conexiones oracle a pool
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user