diff --git a/nitro.config.ts b/nitro.config.ts index ed103e3..6281dfb 100644 --- a/nitro.config.ts +++ b/nitro.config.ts @@ -37,7 +37,7 @@ if (process.env.VERCEL) { default: { connector: "cloudflare-d1", options: { - bindingName: "NEWSNOW_DEV", + bindingName: "NEWSNOW_DB", }, }, } diff --git a/server/database/cache.ts b/server/database/cache.ts index 8267d8f..0fc524a 100644 --- a/server/database/cache.ts +++ b/server/database/cache.ts @@ -49,7 +49,6 @@ export async function getCacheTable() { try { // 如果没有数据库,这里不会报错,只会在第一次访问的时候报错 const db = useDatabase() - if (process.env.CF_PAGES_BRANCH && process.env.CF_PAGES_BRANCH !== "main") return if (process.env.NODE_ENV && process.env.NODE_ENV !== "production") return const cacheTable = new Cache(db) if (process.env.INIT_TABLE !== "false") await cacheTable.init()