Skip to content

Commit

Permalink
load-more: Fix exponential backoff logic
Browse files Browse the repository at this point in the history
I must have been tired when I wrote this, because I got all the min()s
and max()s backwards.  Every single one. :(
  • Loading branch information
josh-berry committed Sep 22, 2024
1 parent 12748db commit e386e5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/load-more.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ export default defineComponent({
computed: {
actualInitialRetryMS(): number {
// How long should we wait for the FIRST retry?
return Math.min(1, this.initialRetryMS ?? 5);
return Math.max(1, this.initialRetryMS ?? 5);
},
actualRetryBackoffExponent(): number {
return Math.min(1, Math.max(2, this.retryBackoffExponent ?? 1.3));
return Math.max(1, Math.min(2, this.retryBackoffExponent ?? 1.1));
},
actualMaxRetryMS(): number {
// Minimum retry time is the length of a single frame (for most
// people). Generally this number should be much higher though (and
// defaults to 15 seconds).
return Math.min(1 / 60.0, this.maxRetryMS ?? 15000);
return Math.max(1 / 60.0, this.maxRetryMS ?? 15000);
},
},
Expand Down

0 comments on commit e386e5e

Please sign in to comment.