mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-19 11:19:14 +08:00
chore: disable cache when development
This commit is contained in:
parent
36739cf619
commit
182af0cf9a
@ -4,7 +4,9 @@ import { Cache } from "#/database/cache"
|
|||||||
export function useCache() {
|
export function useCache() {
|
||||||
try {
|
try {
|
||||||
const db = useDatabase()
|
const db = useDatabase()
|
||||||
if (db && process.env.NODE_ENV === "production") return new Cache(db)
|
if (process.env.CF_PAGES_BRANCH && process.env.CF_PAGES_BRANCH !== "production") return
|
||||||
|
if (process.env.NODE_ENV && process.env.NODE_ENV !== "production") return
|
||||||
|
if (db) return new Cache(db)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error("failed to init database ", e)
|
logger.error("failed to init database ", e)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user