Skip to content

Commit

Permalink
Add this.feedLastBackoff
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Feb 6, 2024
1 parent b7cd4fe commit 18429ce
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/feeds/FeedReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export class FeedReader {
const backoffDuration = Math.min(FEED_BACKOFF_TIME_MAX_MS, (
Math.ceil((Math.random() + 0.5) * FEED_BACKOFF_TIME_MS)) + Math.pow(this.feedLastBackoff.get(url) ?? 0, FEED_BACKOFF_POW));
this.feedBackoff.set(url, Date.now() + backoffDuration);
this.feedLastBackoff.set(url, backoffDuration);
const error = err instanceof Error ? err : new Error(`Unknown error ${err}`);
const feedError = new FeedError(url.toString(), error, fetchKey);
log.error("Unable to read feed:", feedError.message, `backing off for ${backoffDuration}ms`);
Expand Down

0 comments on commit 18429ce

Please sign in to comment.