From c5047af0c333c397c7302416b81aee2c44a517a1 Mon Sep 17 00:00:00 2001 From: 3003h Date: Mon, 11 Nov 2024 18:00:13 +0800 Subject: [PATCH] Update rate limit configuration, relax restrictions. --- lib/network/app_dio/app_dio.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/network/app_dio/app_dio.dart b/lib/network/app_dio/app_dio.dart index 8a450a0e2..12ebad492 100644 --- a/lib/network/app_dio/app_dio.dart +++ b/lib/network/app_dio/app_dio.dart @@ -99,14 +99,14 @@ class AppDio with DioMixin implements Dio { // 缩略图请求的限频配置 final thumbRateLimitConfig = RateLimitConfig( - maxTokens: 10, - refillDuration: const Duration(milliseconds: 500), + maxTokens: 20, + refillDuration: const Duration(milliseconds: 400), ); // 限频 桶令牌 interceptors.add( TokenBucketInterceptor( - defaultMaxTokens: 5, // 默认令牌桶最大容量 + defaultMaxTokens: 15, // 默认令牌桶最大容量 defaultRefillDuration: const Duration(seconds: 500), // 默认令牌补充间隔时间 globalLimit: false, // 是否全局限制 hostConfig: { @@ -117,12 +117,12 @@ class AppDio with DioMixin implements Dio { // 缩略图 (封面?) 's.exhentai.org': thumbRateLimitConfig, 'e-hentai.org': RateLimitConfig( - maxTokens: 5, - refillDuration: const Duration(seconds: 1), + maxTokens: 8, + refillDuration: const Duration(seconds: 600), ), 'exhentai.org': RateLimitConfig( - maxTokens: 5, - refillDuration: const Duration(seconds: 1), + maxTokens: 6, + refillDuration: const Duration(seconds: 600), ), }, ),