tokers commented on a change in pull request #4604: URL: https://github.com/apache/apisix/pull/4604#discussion_r671926516
##########
File path: docs/zh/latest/plugins/limit-conn.md
##########
@@ -30,7 +30,7 @@ title: limit-conn
| conn | integer | required | | conn > 0
| 允许的最大并发请求数。超过
`conn` 的限制、但是低于 `conn` + `burst` 的请求,将被延迟处理。
|
| burst | integer | required | | burst >= 0
|
允许被延迟处理的并发请求数。
|
| default_conn_delay | number | required | | default_conn_delay > 0
|
默认的典型连接(或请求)的处理延迟时间。
|
-| delay_strict_mode | boolean | optional | false | [true,false]
| 延迟时间的严格模式.
如果设置为`true`的话,将会严格按照设置的时间来进行延迟
|
+| only_use_default_delay | boolean | optional | false | [true,false]
|
延迟时间的严格模式. 如果设置为`true`的话,将会严格按照设置的时间来进行延迟
|
Review comment:
`.` is the period symbol in English, shall we use `。`?
##########
File path: t/plugin/limit-conn2.t
##########
@@ -178,3 +178,76 @@ qr/request latency is/
--- grep_error_log_out
request latency is
request latency is
+
+
+
+=== TEST 5: set only_use_default_delay option to true in specific route
+--- config
+ location /t {
+ content_by_lua_block {
+ local t = require("lib.test_admin").test
+ local t = require("lib.test_admin").test
+ local code, body = t('/apisix/admin/global_rules/1',
+ ngx.HTTP_PUT,
+ [[{
+ "plugins": {
+ "limit-conn": {
+ "conn": 1,
+ "burst": 0,
+ "default_conn_delay": 0.3,
+ "rejected_code": 503,
+ "key": "remote_addr"
+ }
+ }
+ }]]
+ )
+
+ if code >= 300 then
+ ngx.status = code
+ ngx.say(body)
+ return
+ end
+
+ local code, body = t('/apisix/admin/routes/1',
+ ngx.HTTP_PUT,
+ [[{
+ "uri": "/hello1",
+ "plugins": {
+ "limit-conn": {
+ "conn": 1,
+ "burst": 0,
+ "default_conn_delay": 0.3,
+ "only_use_default_delay": true,
+ "rejected_code": 503,
+ "key": "remote_addr"
+ }
+ },
+ "upstream": {
+ "nodes": {
+ "127.0.0.1:1982": 1
+ },
+ "type": "roundrobin"
+ }
+ }]]
+ )
+
+ if code >= 300 then
+ ngx.status = code
+ end
+ ngx.say(body)
+ }
+ }
+--- response_body
+passed
+
+
+=== TEST 6: hit route
+--- log_level: debug
+--- request
+GET /hello1
+--- grep_error_log eval
+qr/request latency is/
+--- grep_error_log_out
+request latency is
+request latency is
+
Review comment:
Redundant empty line.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
