修复 drizzle 编译问题 & 简化页面结构与排序功能
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user