title: Python/Flask: only one user can call a endpoint at one time
body: <p>I have a API build using Python/Flask, and I have a endpoint called <code>/build-task</code> that called by the system, and this endpoint takes about 30 minutes to run. </p>
  
  <p>My question is that how do I lock the <code>/build-task</code> endpoint when it's started and running already? So so other user, or system CANNOT call this endpoint. </p>