Answer the question
In order to leave comments, you need to log in
Why do VK callback API requests take a long time to arrive?
Each event (new message, new comment, new post) takes ~10 seconds, this has been stable for a week now.
I haven't been able to figure out why for a week now. I asked TP VK, but they are silent.
I write in node.js. I changed the version of the node 3 times already, removed nginx, now only one script is running on port 80. Completely deleted the server and did everything in a new way. My script for accepting requests:
var http = require("http");
http.createServer(function(req, res) {
console.log(req, res); вот здесь консолятся запросы, которые приходят только через 10 сек
if (req.method !== 'POST') return req.connection.destroy();
var body = "";
req.on('data', function(chunk) {
body += chunk;
});
req.on('end', function() {
console.log(body);
try {
body = JSON.parse(body);
} catch (e) {
body = null;
return req.connection.destroy();
}
console.log(body);
switch(body.type) {
case 'confirmation':
res.end('тут моя строка, которую надо вернуть');
break;
default:
res.end('OK');
}
});
}).listen(80);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question