2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-28 12:57:38 +00:00

After polling error, keep trying

This commit is contained in:
yago 2015-07-12 11:45:42 +02:00
parent a17755eb0d
commit 8a0a594177

View File

@ -111,6 +111,10 @@ TelegramBot.prototype._polling = function (timeout) {
this.getUpdates(timeout).then(function (data) {
self._processUpdates(data);
self._polling(timeout);
}).catch(function (err) {
// console.error(err);
// Wait for 2 seconds before retry
setTimeout(self._polling.bind(self), 2000, timeout);
});
};