Skip to content

Commit

Permalink
Update rate limit configuration, relax restrictions.
Browse files Browse the repository at this point in the history
  • Loading branch information
3003h committed Nov 11, 2024
1 parent ab87d29 commit 3943e3c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/network/app_dio/app_dio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ 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, // 默认令牌桶最大容量
defaultRefillDuration: const Duration(seconds: 500), // 默认令牌补充间隔时间
defaultMaxTokens: 15, // 默认令牌桶最大容量
defaultRefillDuration: const Duration(milliseconds: 500), // 默认令牌补充间隔时间
globalLimit: false, // 是否全局限制
hostConfig: {
// 缩略图 详情页
Expand All @@ -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(milliseconds: 600),
),
'exhentai.org': RateLimitConfig(
maxTokens: 5,
refillDuration: const Duration(seconds: 1),
maxTokens: 6,
refillDuration: const Duration(milliseconds: 600),
),
},
),
Expand Down

0 comments on commit 3943e3c

Please sign in to comment.