修复 drizzle 编译问题 & 简化页面结构与排序功能

This commit is contained in:
2025-09-29 10:35:16 +08:00
parent 72ea29f435
commit 8239c9fb37
5 changed files with 32 additions and 41 deletions

View File

@@ -1,9 +1,14 @@
import 'server-only'
import { createClient } from 'redis'
const client = createClient({
url: process.env.REDIS_URL,
})
declare global {
var redis: ReturnType<typeof createClient> | undefined
}
const client = global.redis || createClient({ url: process.env.REDIS_URL })
if (process.env.NODE_ENV !== 'production') {
global.redis = client
}
const redis = await client.connect()
export default redis