I'm trying to call a function where I'm trying to do simple operation in the target function but I saw that thread is triggering the same function multiple times
def __init_application():
app = FastAPI(title="Test", version="0.1")
feedback_ack = Thread(target=test_ack)
feedback_ack.start()
return app
api_app = __init_application()
def test_ack():
var = 0
while True:
if var>5:
break
var+=1
print(var)
But as this thread is calling this multiple times, it is printing weirdly.
So what could be the solution for this?