mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
- Replace .eslintrc.js with .eslintrc.cjs for better ES module compatibility - Add .prettierrc configuration for consistent code formatting - Update package.json with new lint and format scripts - Add nodemon.json for development hot reloading configuration - Standardize code formatting across all JavaScript and Vue files - Update web admin SPA with improved linting rules and formatting - Add prettier configuration to web admin SPA 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
54 lines
1.2 KiB
JavaScript
54 lines
1.2 KiB
JavaScript
/**
|
|
* 检查 Redis 中的所有键
|
|
*/
|
|
|
|
const redis = require('../src/models/redis')
|
|
|
|
async function checkRedisKeys() {
|
|
console.log('🔍 检查 Redis 中的所有键...\n')
|
|
|
|
try {
|
|
// 确保 Redis 已连接
|
|
await redis.connect()
|
|
|
|
// 获取所有键
|
|
const allKeys = await redis.client.keys('*')
|
|
console.log(`找到 ${allKeys.length} 个键\n`)
|
|
|
|
// 按类型分组
|
|
const keysByType = {}
|
|
|
|
allKeys.forEach((key) => {
|
|
const prefix = key.split(':')[0]
|
|
if (!keysByType[prefix]) {
|
|
keysByType[prefix] = []
|
|
}
|
|
keysByType[prefix].push(key)
|
|
})
|
|
|
|
// 显示各类型的键
|
|
Object.keys(keysByType)
|
|
.sort()
|
|
.forEach((type) => {
|
|
console.log(`\n📁 ${type}: ${keysByType[type].length} 个`)
|
|
|
|
// 显示前 5 个键作为示例
|
|
const keysToShow = keysByType[type].slice(0, 5)
|
|
keysToShow.forEach((key) => {
|
|
console.log(` - ${key}`)
|
|
})
|
|
|
|
if (keysByType[type].length > 5) {
|
|
console.log(` ... 还有 ${keysByType[type].length - 5} 个`)
|
|
}
|
|
})
|
|
} catch (error) {
|
|
console.error('❌ 错误:', error)
|
|
console.error(error.stack)
|
|
} finally {
|
|
process.exit(0)
|
|
}
|
|
}
|
|
|
|
checkRedisKeys()
|