动漫标题缓存最大数量可配置化 (#264)
* Update vercel.json * Update vercel.json * Add files via upload 动漫标题缓存最大数量可配置化修改,在某些场景下通过接口获取的标题数会超过100,没有缓存到的标题无法通过id获取到弹幕,增加动漫标题缓存最大数量可配置化修改 --------- Co-authored-by: huangxd- <649924757@qq.com>
This commit is contained in:
1 parent
3956d80e98
commit
2c3f574cd0
3 files changed
+5
-4
No files matched your search
@@ -535,6 +535,7 @@ export class Envs {
|
||||
'COMMENT_CACHE_MINUTES': { category: 'cache', type: 'number', description: '弹幕缓存时间(分钟),默认3', min: 1, max: 120 },
|
||||
'REMEMBER_LAST_SELECT': { category: 'cache', type: 'boolean', description: '记住手动选择结果' },
|
||||
'MAX_LAST_SELECT_MAP': { category: 'cache', type: 'number', description: '记住上次选择映射缓存大小限制', min: 10, max: 1000 },
|
||||
'MAX_ANIMES': { category: 'cache', type: 'number', description: '动漫标题缓存最大数量', min: 100, max: 1000 },
|
||||
'UPSTASH_REDIS_REST_URL': { category: 'cache', type: 'text', description: 'Upstash Redis请求链接' },
|
||||
'UPSTASH_REDIS_REST_TOKEN': { category: 'cache', type: 'text', description: 'Upstash Redis访问令牌' },
|
||||
'LOCAL_REDIS_URL': { category: 'cache', type: 'text', description: '本地 Redis 连接URL,示例:redis://:password@127.0.0.1:6379/0,只支持本地部署和docker部署' },
|
||||
@@ -600,7 +601,8 @@ export class Envs {
|
||||
aiApiKey: this.get('AI_API_KEY', '', 'string', true), // AI服务API密钥
|
||||
aiMatchPrompt: this.get('AI_MATCH_PROMPT', this.DEFAULT_AI_MATCH_PROMPT, 'string'), // AI自动匹配提示词模板
|
||||
rememberLastSelect: this.get('REMEMBER_LAST_SELECT', true, 'boolean'), // 是否记住手动选择结果,用于match自动匹配时优选上次的选择(默认 true,记住)
|
||||
MAX_LAST_SELECT_MAP: this.get('MAX_LAST_SELECT_MAP', 100, 'number'), // 记住上次选择映射缓存大小限制(默认 100)
|
||||
MAX_LAST_SELECT_MAP: this.get('MAX_LAST_SELECT_MAP', 100, 'number'),
|
||||
MAX_ANIMES: this.get('MAX_ANIMES', 100, 'number'), // 动漫标题缓存最大数量(默认 100)
|
||||
deployPlatformAccount: this.get('DEPLOY_PLATFROM_ACCOUNT', '', 'string', true), // 部署平台账号ID配置(默认空)
|
||||
deployPlatformProject: this.get('DEPLOY_PLATFROM_PROJECT', '', 'string', true), // 部署平台项目名称配置(默认空)
|
||||
deployPlatformToken: this.get('DEPLOY_PLATFROM_TOKEN', '', 'string', true), // 部署平台项目名称配置(默认空)
|
||||
|
||||
@@ -15,7 +15,6 @@ export const Globals = {
|
||||
// 静态常量
|
||||
VERSION: '1.18.1',
|
||||
MAX_LOGS: 1000, // 日志存储,最多保存 1000 行
|
||||
MAX_ANIMES: 100,
|
||||
MAX_RECORDS: 100, // 请求记录最大数量
|
||||
|
||||
// 运行时状态
|
||||
@@ -164,7 +163,7 @@ export const Globals = {
|
||||
// 映射大写常量到小写
|
||||
if (prop === 'version') return self.VERSION;
|
||||
if (prop === 'maxLogs') return self.MAX_LOGS;
|
||||
if (prop === 'maxAnimes') return self.MAX_ANIMES;
|
||||
if (prop === 'maxAnimes') return self.envs.MAX_ANIMES;
|
||||
if (prop === 'maxRecords') return self.MAX_RECORDS;
|
||||
if (prop === 'maxLastSelectMap') return self.MAX_LAST_SELECT_MAP;
|
||||
|
||||
|
||||
+1
-1
@@ -24,4 +24,4 @@
|
||||
"dest": "/danmu_api/worker.js"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user