mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
chore
This commit is contained in:
@@ -41,7 +41,9 @@ async function migrate() {
|
||||
stats.dailyIndex++
|
||||
}
|
||||
}
|
||||
if (keys.length > 0) await pipeline.exec()
|
||||
if (keys.length > 0) {
|
||||
await pipeline.exec()
|
||||
}
|
||||
} while (cursor !== '0')
|
||||
console.log(` 已处理 ${stats.dailyIndex} 条`)
|
||||
|
||||
@@ -63,7 +65,9 @@ async function migrate() {
|
||||
stats.hourlyIndex++
|
||||
}
|
||||
}
|
||||
if (keys.length > 0) await pipeline.exec()
|
||||
if (keys.length > 0) {
|
||||
await pipeline.exec()
|
||||
}
|
||||
} while (cursor !== '0')
|
||||
console.log(` 已处理 ${stats.hourlyIndex} 条`)
|
||||
|
||||
@@ -85,7 +89,9 @@ async function migrate() {
|
||||
stats.modelDailyIndex++
|
||||
}
|
||||
}
|
||||
if (keys.length > 0) await pipeline.exec()
|
||||
if (keys.length > 0) {
|
||||
await pipeline.exec()
|
||||
}
|
||||
} while (cursor !== '0')
|
||||
console.log(` 已处理 ${stats.modelDailyIndex} 条`)
|
||||
|
||||
@@ -93,7 +99,13 @@ async function migrate() {
|
||||
console.log('\n4. 迁移 usage:model:hourly 索引...')
|
||||
cursor = '0'
|
||||
do {
|
||||
const [newCursor, keys] = await redis.scan(cursor, 'MATCH', 'usage:model:hourly:*', 'COUNT', 500)
|
||||
const [newCursor, keys] = await redis.scan(
|
||||
cursor,
|
||||
'MATCH',
|
||||
'usage:model:hourly:*',
|
||||
'COUNT',
|
||||
500
|
||||
)
|
||||
cursor = newCursor
|
||||
|
||||
const pipeline = redis.pipeline()
|
||||
@@ -107,7 +119,9 @@ async function migrate() {
|
||||
stats.modelHourlyIndex++
|
||||
}
|
||||
}
|
||||
if (keys.length > 0) await pipeline.exec()
|
||||
if (keys.length > 0) {
|
||||
await pipeline.exec()
|
||||
}
|
||||
} while (cursor !== '0')
|
||||
console.log(` 已处理 ${stats.modelHourlyIndex} 条`)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user