我有一个超过 200 万条可用消息的 FIFO 队列。我想用 lambda 函数来处理它们,但是在我轮询消息的 10 次中有 9 次我得到队列为空的答复。这绝对不是真的。我尝试更改为长轮询,但没有帮助。这是我用于轮询消息的代码。
import { create as listenToSqsQueue } from "sqs-consumer";
listenToSqsQueue({
queueUrl: Config.aws.sqsurl,
handleMessage: async function (message, done){
// do some work with `message`s
Promise.resolve(invokePoller(functionName, message, callback));
done();
}
,
batchSize: 10
}).on("empty", function() {
callback(undefined, "Queue is empty");
}).on("error", function(error: Error, message: any) {
console.error(error, message);
callback(error)
}).start();
Run Code Online (Sandbox Code Playgroud) 现在,在不更改我的代码或配置的情况下,谷歌要求用户每次尝试对我的应用进行身份验证时都向用户授予权限。即使用户已经磨碎了访问权限,范围也没有改变。
我没有收到任何错误,登录正常,只是现在每次都会出现询问权限的Google对话框。
要初始化google,请使用带有“ https://www.googleapis.com/auth/plus.profile.emails.read ”作为范围的gapi.auth2.init。为了请求访问,我使用auth2.grantOfflineAccess。
我还在Google帐户中签入了具有访问权限的应用,并且该应用已在其中成功注册。
还有其他人看到过这个问题吗?还是不知道Google是否改变了他们处理权限的方式?