Browse Source

Fix mistake whereby the caches for each guild would update synchronously

shorten
benji7425 4 years ago
parent
commit
5e5929565e
  1. 14
      app/models/guild-data.js

14
app/models/guild-data.js

@ -8,14 +8,12 @@ module.exports = class GuildData {
}
cachePastPostedLinks() {
let i = 0;
const recurse = () => {
this.feeds[i++].cachePastPostedLinks(this)
.catch(Util.dateError)
.then(recurse);
if (i > this.feeds.length)
return Promise.resolve();
};
const promises = [];
this.feeds.forEach(feed => {
promises.push(feed.cachePastPostedLinks(this).catch(Util.dateError));
});
return Promise.all(promises);
}
};
Loading…
Cancel
Save