最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

flask - Too many VScode-Python processes. (APi and sqlserver) - Stack Overflow

programmeradmin4浏览0评论

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')
    connmit() 
    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.

发布评论

评论列表(0)

  1. 暂无评论