Revert: 撤销 584fa8c 之后的所有提交

This commit is contained in:
SunSeekerX
2026-01-03 23:24:59 +08:00
parent 74e71d0afc
commit 90023d1551
27 changed files with 219 additions and 488 deletions

View File

@@ -41,9 +41,7 @@ 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}`)
@@ -65,9 +63,7 @@ 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}`)
@@ -89,9 +85,7 @@ 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}`)
@@ -99,13 +93,7 @@ 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()
@@ -119,9 +107,7 @@ 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}`)