缓存相关代码整合

This commit is contained in:
tangly1024
2025-01-05 19:57:25 +08:00
parent 497915655c
commit bb612dede2
2 changed files with 60 additions and 4 deletions

View File

@@ -1,8 +1,9 @@
import Redis from 'ioredis'
import BLOG from '@/blog.config'
import { siteConfig } from '@/lib/config'
import Redis from 'ioredis'
export const redisClient = BLOG.REDIS_URL ? new Redis(BLOG.REDIS_URL) : {}
export const redisClient = new Redis(BLOG.REDIS_URL)
const cacheTime = Math.trunc(
siteConfig('NEXT_REVALIDATE_SECOND', BLOG.NEXT_REVALIDATE_SECOND) * 1.5
)