My code looks like this:
app = Flask(__name__)
def target():
while True:
time.sleep(10)
print('ok')
if __name__ == '__main__':
thread(target = target, args = ()).start()
app.run()
Why the target function runs twice ?? (I mean, the output is 2 'ok'
after every 10 seconds)