From 57e4507bff56ec5ab725e6d65d82d8a7e2ae5d8a Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Wed, 18 Aug 2021 12:15:34 +1200 Subject: [PATCH] Don't quit background refresh loop on error --- background/feed-update.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/background/feed-update.js b/background/feed-update.js index a94766e..7c9b218 100644 --- a/background/feed-update.js +++ b/background/feed-update.js @@ -117,7 +117,15 @@ class Refresher { if (!this.refreshQueue.isEmpty()) { this.state = this.sym.ACTIVE const ucid = this.refreshQueue.next() - this.refreshChannel(ucid).then(() => this.next()) + this.refreshChannel(ucid).then(() => this.next()).catch(error => { + // Problems related to fetching from the instance? + // All we can do is retry later. + // However, skip this channel this time in case the problem will occur every time. + console.error(error) + setTimeout(() => { + this.next() + }, 10e3) + }) } else { this.state = this.sym.EMPTY }