This commit is contained in:
zy123 2025-02-11 16:35:23 +08:00
parent 7b930e311f
commit 703ab94ade
2 changed files with 5 additions and 5 deletions

View File

@ -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 # 这个函数本身不执行任何操作,只用于限流

View File

@ -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):