我使用以下app.yaml配置部署了在Google App Engine Flex运行时上运行的nodejs应用程序:
runtime: nodejs
env: flex
health_check:
enable_health_check: True
check_interval_sec: 20
timeout_sec: 4
unhealthy_threshold: 2
healthy_threshold: 2
Run Code Online (Sandbox Code Playgroud)
根据运行状况检查文档,运行状况检查应/_ah/health每20秒触发一次端点.但是我注意到我的应用程序每秒多次使用这些运行状况检查发送垃圾邮件,即使应用程序使用200状态代码进行响应:
知道为什么会这样吗?
我本质上是试图通过使用localStorage后台脚本中的对象来获得我的chrome扩展的持久存储.
这是设置:
我有一个后台脚本和一个内容脚本.内容脚本需要从扩展名中获取/设置数据localStorage.
但是,我无法收到要发送到后台脚本的消息.
这是后台脚本中的代码:
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
console.log(sender.tab ? "from a content script:" + sender.tab.url : "from the extension");
if (request.greeting == "hello")
sendResponse({farewell: "goodbye"});
});
Run Code Online (Sandbox Code Playgroud)
和内容脚本:
setTimeout(function () {
chrome.runtime.sendMessage({greeting: "hello"}, function(response) {
console.log(response.farewell);
});
}, 5000);
Run Code Online (Sandbox Code Playgroud)
理想情况下,后台脚本应输出from a content script: [some url],内容脚本应输出goodbye.相反,我得到以下错误:
Port: Could not establish connection. Receiving end does not exist.
Run Code Online (Sandbox Code Playgroud)
任何帮助/建议表示赞赏!
谢谢 :)
编辑:清单
{
"manifest_version": 2,
"name": "Helios",
"description": "Helios chrome extension.",
"version": "0.0.1",
"permissions": …Run Code Online (Sandbox Code Playgroud)