From: qydysky Date: Tue, 29 Oct 2024 11:41:27 +0000 (+0800) Subject: 1 X-Git-Tag: v0.1.20241029114309 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=2caec4a1f595703540c445b14f7884592227aca8;p=front%2F.git 1 --- diff --git a/README.md b/README.md index 69b761d..e40fa27 100755 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ config: - *copyBlocks*: int 转发的块数量,默认`1000` - *retryBlocks*: {} 重试 - *sizeB*: int 重试的块大小,默认`1000000` - - *num*: int 重试的块数量,默认`1000`,为`-1`时停用重试 + - *num*: int 重试的块数量,默认`0`,为`0`时停用重试 - *tls*: {} 启用tls, 默认空 - *pub*: string 公钥pem路径 - *key*: string 私钥pem路径 @@ -62,7 +62,7 @@ setting: json配置不需要setting - filiter: - reqUri: 请求后端前,请求路径过滤器 - - accessRule: 布尔表达式,为true时才通过 + - accessRule: 布尔表达式,为true时才通过,例`{id}|(!{id2}&{id3})` - items: map[string]string - id: matchExp - reqHeader: 请求后端前,请求头处理器 diff --git a/config.go b/config.go index f59519c..b6546cd 100755 --- a/config.go +++ b/config.go @@ -74,9 +74,6 @@ func (t *Config) Run(ctx context.Context, logger Logger) { if t.RetryBlocks.SizeB == 0 { t.RetryBlocks.SizeB = humanize.MByte } - if t.RetryBlocks.Num == 0 { - t.RetryBlocks.Num = 1000 - } if t.RetryBlocks.SizeB > 0 && t.RetryBlocks.Num > 0 { t.RetryBlocksI = pslice.NewBlocks[byte](t.RetryBlocks.SizeB, t.RetryBlocks.Num) }