diff --git a/app.js b/app.js index 46f90a2..b7f5e5c 100644 --- a/app.js +++ b/app.js @@ -5,7 +5,7 @@ const rs = require("./routes"); // 读取环境变量 const port = process.env.PORT || 8081; -const nodeEnv = process.env.NODE_ENV || 'development'; +const nodeEnv = process.env.NODE_ENV || 'dev'; /** * 初始化框架,并将初始化后的函数给予 '当前页面'全局变量 app diff --git a/routes/index.js b/routes/index.js index ac74704..52f0491 100644 --- a/routes/index.js +++ b/routes/index.js @@ -107,7 +107,16 @@ async function handle(url, htmlStr, jsText, cookie, userAgent) { let internalVMContext = dom.getInternalVMContext(); script.runInContext(internalVMContext); // 等待 onbeforeunload 钩子触发后的回掉 - let val = await store.waitGetAndDelete(uuid, 100, 10) + let timeout; + let reTry; + if (process.env.NODE_ENV === 'prod') { + timeout = 100 + reTry = 10 + } else { + timeout = 1000 + reTry = 10 + } + let val = await store.waitGetAndDelete(uuid, timeout, reTry) internalVMContext.close() window.close()