[Python] Too many VScode-Python processes. (APi and sqlserver)

Discussão em 'Python' iniciado por Stack, Fevereiro 18, 2025.

  1. Stack

    Stack Membro Participativo

    I have an API which increases a counter in SQLServer, but it generates too many secondary processes (in one hour I can create up to 40)

    Am I closing the processes wrong? Is there any other method or alternative?

    (I am using Flask and pyodbc)


    @app.route('/datos', methods=['GET'])
    def datos():
    conn = get_db_connection()
    if conn is None:
    return jsonify({'error': 'Error al conectar a la base de datos'}), 500
    cursor = conn.cursor()
    cursor.execute('exec otros')
    conn.commit()
    cursor.close()
    conn.close()
    return "coneccion exitoso"


    I'm looking for a way to leave the api running without vscode taking up all the memory on my pc.

    Continue reading...

Compartilhe esta Página