Don't quit background refresh loop on error

This commit is contained in:
Cadence Ember 2021-08-18 12:15:34 +12:00
parent 739f537bc7
commit 57e4507bff
No known key found for this signature in database
GPG Key ID: BC1C2C61CF521B17
1 changed files with 9 additions and 1 deletions

View File

@ -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
}