Skip to content

Commit

Permalink
Minor changes for more crash-proofing
Browse files Browse the repository at this point in the history
  • Loading branch information
Ambratolm authored and Ambratolm committed Mar 5, 2022
1 parent ada1365 commit 258182c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion @reddit-art-poster-consumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ module.exports = {
this.line();

// Fetch schedule references
const fetchedSchedRefsCount = await redditArtPoster.fetchSchedRefs();
const fetchedSchedRefsCount = await redditArtPoster.fetchSchedRefs({
force: true,
});
this.line();
this.log(
`${fetchedSchedRefsCount} / ${redditArtPoster.count} schedule references fetched.`
Expand Down
4 changes: 2 additions & 2 deletions bots/reddit-art-poster/tasklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ module.exports = class Tasklist {
for (const [i, task] of this._tasks.entries()) {
if (await task.execute()) {
count++;
if (save) await this.save();
await sleep(random(1000, 5000));
}
if (i < this._tasks.length - 1) console.line();
}
if (save) await this.save();
return count;
}

Expand All @@ -63,10 +63,10 @@ module.exports = class Tasklist {
for (const task of this._tasks) {
if (await task.fetchScheduleReference({ force })) {
count++;
if (save) await this.save();
await sleep(random(1000, 5000));
}
}
if (save) await this.save();
return count;
}

Expand Down

0 comments on commit 258182c

Please sign in to comment.