fix: cloudflare cache

This commit is contained in:
Ou 2024-10-24 00:35:50 +08:00
parent 00b089ff53
commit 811776930c

View File

@ -4,7 +4,7 @@ import { Cache } from "#/database/cache"
export function useCache() {
try {
const db = useDatabase()
if (process.env.CF_PAGES_BRANCH && process.env.CF_PAGES_BRANCH !== "production") return
if (process.env.CF_PAGES_BRANCH && process.env.CF_PAGES_BRANCH !== "main") return
if (process.env.NODE_ENV && process.env.NODE_ENV !== "production") return
if (db) return new Cache(db)
} catch (e) {