Skip to content

Commit ad61594

Browse files
committed
Improve back off timing, and UI color
1 parent 655846a commit ad61594

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/components/VenueProfile/modals/FlagModal.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@
7777
}
7878

7979
.flag-venue-modal__sending {
80-
background-color: rgba(0, 128, 255, 0.2);
81-
border: solid 1px royalblue;
80+
background-color: var(--button-active-color);
81+
border: solid var(--accent-color) 1px;
8282
color: white;
8383
padding: 10px;
8484
border-radius: 5px;

src/services/utils/request.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import {sleep} from "./sleep";
66
export async function request(requestUrl, requestOptions = {}, backOffOptions = {}) {
77
let {
88
maxRetries = 5,
9-
baseDelayMs = 1000,
10-
maxDelayMs = 12_000,
9+
baseDelayMs = 1250,
10+
maxDelayMs = 15_000,
1111
retryOnStatuses = new Set([429]),
1212
retryOnNetworkError = true,
1313
cancellationSignal = requestOptions.signal, // Abort signal
@@ -101,9 +101,9 @@ function getBackOffInMs({ response, retry, baseDelayMs, maxDelayMs }) {
101101

102102
function computeBackoffWithJitter(retry, baseDelayMs, maxDelayMs) {
103103
// Exponential backoff base * 2^attempt
104-
const backOff = baseDelayMs * Math.pow(2, retry);
105-
const jitteredBackOff = Math.random() * backOff;
106-
return clamp(jitteredBackOff, baseDelayMs, maxDelayMs);
104+
const backOff = baseDelayMs * Math.pow(2, retry-1);
105+
const jitter = Math.random() * .15 * backOff;
106+
return clamp(backOff + jitter, baseDelayMs, maxDelayMs);
107107
}
108108

109109
function getRetryAfterInMs(response) {

0 commit comments

Comments
 (0)