我正在使用 IONIC 3 构建应用程序,并且在构建生产应用程序时遇到了 JS 问题。
我使用代码ionic cordova build ios --prod
并出现以下错误
<--- Last few GCs --->
[2769:0x104000000] 198493 ms: Mark-sweep 8037.6 (8188.4) -> 8037.6 (8189.4) MB, 10477.9 / 0.0 ms (average mu = 0.108, current mu = 0.001) allocation failure scavenge might not succeed
[2769:0x104000000] 211226 ms: Mark-sweep 8038.6 (8189.4) -> 8038.5 (8190.9) MB, 12720.3 / 0.0 ms (average mu = 0.048, current mu = 0.001) allocation failure scavenge might not succeed
<--- JS stacktrace --->
==== JS …Run Code Online (Sandbox Code Playgroud) 我有一个在数据库中生成数据的 API 路由,该 API 路由仅在我在 Vercel 中设置的 CRON 作业中调用。
但是,每次我构建项目时,新数据都会显示在数据库中。我确实相信这是因为 NextJS 的本质是预先执行端点,因此它会在缓存中,但如何防止在数据库中添加数据?
export const revalidate = 60 * 60 * 24 * 6; // every 6 days
export async function GET(request: Request) {
const url =
`${process.env.COINMARKETCAP_URL}/v1/cryptocurrency/listings/latest?limit=100` ??
"";
var options = {
headers: {
"X-CMC_PRO_API_KEY": process.env.COINMARKETCAP_API ?? "",
},
next: { revalidate: 60 * 60 * 24 * 6 },
};
const res = await fetch(url, options);
const data = await res.json();
const tokensList: Tokens[] = …Run Code Online (Sandbox Code Playgroud)