Forums

code inside multiprocessing dummy pool not getting executed

So I deployed a flask server and made an HTTP request from my PC. The method returned status 202 as expected. But the process is not starting.

@app.route("/put-data-on-sheet/returns")
def display_returns():
    sheet_id = request.args.get("sheet_id")
    start = request.args.get("start")
    end = request.args.get("end")
    method = request.args.get("method")
    handled = request.args.get("handled") in ["True", "true"]

    pool.apply_async(service.display_returns, (sheet_id, start, end, method, handled))
    return jsonify({"success": True}), 202

So which it does return the code but I don't think it's really executing the code in pool.apply_async() Nor does it throw any message or errors. I have placed many print statements to check but the fact that it does not even enter the service.display_returns() method. Does pythonanywhere has any problems with multiprocessing dummy pool ?

The multiprocessing dummy pool uses threads, so it will not work in a web app on PythonAnywhere.