我已经使用Google Compute Engine设置了我的新服务器.我将用户及其公钥添加到Google Cloud控制台(sshKeys)中的元数据中.
我试图替换元数据中的公钥,但现在旧的似乎是唯一能够ssh进入我的服务器的公钥(使用PuTTY).新的似乎没有更新.
现在,即使我删除整个元数据或在sshKeys字段中键入乱码文本,它仍然可以工作!
是不是需要一段时间才能将元数据推送到服务器(我以前的尝试是瞬间完成的)?
ssh putty metadata google-compute-engine google-cloud-platform
我使用一个名为Puppeteer的模块。
我尝试在我的页面上等待一个可能不会出现的选择器。在我采用的两种方法中,只有 try-catch 方法有效。
try-catch 块 - 工作
try {
await page.waitForSelector('.element');
//element appeared
} catch (error) {
//element did not appear
}
Run Code Online (Sandbox Code Playgroud)
承诺链 - 不工作
await page.waitForSelector('.element')
.catch((error) => {
//element did not appear
})
.then(() => {
//element appeared
});
Run Code Online (Sandbox Code Playgroud)
看起来 waitForSelector确实返回了 API 中指示的 Promise,但我不明白为什么后一种方法不起作用。无论如何它抛出了错误。
有没有人遇到过同样的问题?