2.11
This commit is contained in:
parent
7b930e311f
commit
703ab94ade
@ -43,7 +43,7 @@ def upload_file(file_path,output_folder=""):
|
|||||||
return file_id
|
return file_id
|
||||||
|
|
||||||
@sleep_and_retry
|
@sleep_and_retry
|
||||||
@limits(calls=8, period=1) # 每秒最多调用4次
|
@limits(calls=10, period=1) # 每秒最多调用10次
|
||||||
def rate_limiter():
|
def rate_limiter():
|
||||||
pass # 这个函数本身不执行任何操作,只用于限流
|
pass # 这个函数本身不执行任何操作,只用于限流
|
||||||
|
|
||||||
|
@ -24,10 +24,10 @@ def create_app():
|
|||||||
app.register_blueprint(upload_bp)
|
app.register_blueprint(upload_bp)
|
||||||
app.register_blueprint(test_zbparse_bp)
|
app.register_blueprint(test_zbparse_bp)
|
||||||
app.register_blueprint(judge_zbfile_bp)
|
app.register_blueprint(judge_zbfile_bp)
|
||||||
app.connection_limiters['upload'] = ConnectionLimiter(max_connections=10)
|
app.connection_limiters['upload'] = ConnectionLimiter(max_connections=100)
|
||||||
app.connection_limiters['get_deviation'] = ConnectionLimiter(max_connections=10)
|
app.connection_limiters['get_deviation'] = ConnectionLimiter(max_connections=100)
|
||||||
app.connection_limiters['default'] = ConnectionLimiter(max_connections=10)
|
app.connection_limiters['default'] = ConnectionLimiter(max_connections=100)
|
||||||
app.connection_limiters['judge_zbfile']=ConnectionLimiter(max_connections=30)
|
app.connection_limiters['judge_zbfile']=ConnectionLimiter(max_connections=100)
|
||||||
|
|
||||||
@app.teardown_request
|
@app.teardown_request
|
||||||
def teardown_request(exception):
|
def teardown_request(exception):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user