title: How can I make Flask wait?
body: <p>I'm running a program that works with requests. I need to write the feedback time to my database. This code works fine, but it updates my DB too often. How can I make index() method wait for 60s? time.sleep(60) doesn't work here.</p>
  
  <pre><code>app = Flask(__name__)
  app.config['SECRET_KEY'] = 'secret!'
  
  dbconn = mysql.connector.connect(host="myhost", 
                               database='mydb', 
                        user='root', password='12345')
  
  @app.route('/', methods = ['GET', 'POST'])
  def index():
      if request.method == 'POST':
          cursor = dbconn.cursor()
          time_check = datetime.datetime.now()
          query = ("update mytable set response_time=%s where service_name = 'my_service'")
          param = time_check
          cursor.execute(query, (param,))
          print("sent query")
          dbconn.commit()
          cursor.close()
          #time.sleep(60)
  
      return render_template('index.html')
  
  if __name__ == '__main__':
      app.run(host = "myhostaddress", port = 1010)
  </code></pre>