Hi i am trying to run my flask app with one particular function at the same time. For that I am using _thread
.
But when I start my server function called in _thread.start_new_thread()
is called twice. I need to call it just once, any idea where is the problem?
def callPCo():
requests.get("http://127.0.0.1:5120/pco")
if __name__ == '__main__':
_thread.start_new_thread(callPCo, ())
app.run(host = "127.0.0.1", port = "5115", use_reloader=True)