impl rate limit
This commit is contained in:
parent
f945eb462a
commit
46eb1e0045
@ -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():
|
||||
|
Loading…
Reference in New Issue
Block a user