impl rate limit

This commit is contained in:
Akbar Rahman 2023-12-27 23:32:23 +00:00
parent f945eb462a
commit 46eb1e0045
Signed by: alvierahman90
GPG Key ID: 6217899F07CA2BDF

View File

@ -33,7 +33,8 @@ def process():
print("created model")
last = 0
while True:
if time.time() < last + 10:
# wait x seconds before processing another task
if time.time() < last + 2:
print("aa")
time.sleep(0.5)
continue
@ -61,6 +62,8 @@ def process():
filepath.unlink()
last = time.time()
@app.route("/submit", methods=['POST'])
def render():