Forums

Scheduled actions are long delayed: between one and two hours.

Scheduled actions are long delayed: between one and two hours. Lag occurs even though CPU usage: 5% used

How are you scheduling them? I don't see any scheduled tasks set up for your account.

I mean scheduled task in .py file: 1º request.method == 'POST' / 2º action by simultaneous action (threading) / 3º return "", 200. Returns code 200, but does not execute the concurrent action

Previously defined the function guion_fm

@app.route('/zzz', methods=['POST', 'GET'])
    def xxx():
        if request.method == 'POST':
           info = request.json
            adap = json.dumps(info)

            t = threading.Thread(target=guion_fm, args=('aaaa', 'bbbb', adap,))
            t.start()

           return "OK POST", 200
       else:
          return "OK GET", 200

We don't really support threads in website code; if you want to schedule tasks, you should do it from the "Tasks" page inside PythonAnywhere.