impl rate limit
This commit is contained in:
parent
f945eb462a
commit
46eb1e0045
@ -33,7 +33,8 @@ def process():
|
|||||||
print("created model")
|
print("created model")
|
||||||
last = 0
|
last = 0
|
||||||
while True:
|
while True:
|
||||||
if time.time() < last + 10:
|
# wait x seconds before processing another task
|
||||||
|
if time.time() < last + 2:
|
||||||
print("aa")
|
print("aa")
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
continue
|
continue
|
||||||
@ -61,6 +62,8 @@ def process():
|
|||||||
|
|
||||||
filepath.unlink()
|
filepath.unlink()
|
||||||
|
|
||||||
|
last = time.time()
|
||||||
|
|
||||||
|
|
||||||
@app.route("/submit", methods=['POST'])
|
@app.route("/submit", methods=['POST'])
|
||||||
def render():
|
def render():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user