Fix mistake whereby the caches for each guild would update synchronously
This commit is contained in:
parent
c82bece834
commit
5e5929565e
|
@ -8,14 +8,12 @@ module.exports = class GuildData {
|
||||||
}
|
}
|
||||||
|
|
||||||
cachePastPostedLinks() {
|
cachePastPostedLinks() {
|
||||||
let i = 0;
|
const promises = [];
|
||||||
const recurse = () => {
|
|
||||||
this.feeds[i++].cachePastPostedLinks(this)
|
this.feeds.forEach(feed => {
|
||||||
.catch(Util.dateError)
|
promises.push(feed.cachePastPostedLinks(this).catch(Util.dateError));
|
||||||
.then(recurse);
|
});
|
||||||
if (i > this.feeds.length)
|
|
||||||
return Promise.resolve();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
return Promise.all(promises);
|
||||||
}
|
}
|
||||||
};
|
};
|
Loading…
Reference in New Issue