1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-12-22 05:06:57 +00:00

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

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
}