Reset since_id if twitter tells us its invalid

This commit is contained in:
Nick O'Leary 2018-08-17 09:18:53 +01:00
parent 903a123049
commit 35cbcb3345
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 5 additions and 1 deletions

View File

@ -374,6 +374,10 @@ module.exports = function(RED) {
var res = result.body;
if (res.errors) {
node.error(res.errors[0].message);
if (res.errors[0].code === 44) {
// 'since_id parameter is invalid' - reset it for next time
delete opts.since_id;
}
clearInterval(pollId);
node.timeout_ids.push(setTimeout(function() {
node.poll(interval,url,opts);

View File

@ -1,6 +1,6 @@
{
"name": "node-red-node-twitter",
"version": "1.1.1",
"version": "1.1.2",
"description": "A Node-RED node to talk to Twitter",
"dependencies": {
"twitter-ng": "0.6.2",