Flask - Background Tasks
What will happen when this Flask route is called?
import threading
from flask import Flask
app = Flask(__name__)
def slow_task():
import time
time.sleep(5)
print('Task done')
@app.route('/')
def index():
threading.Thread(target=slow_task).start()
return 'Request received'