Skip to content

Commit af1bf58

Browse files
authored
Ensure we use backoff when request fails
Currently, the exponential backoff feature of the `Poll` class is not used since we never throw an error for a bad network request (e.g. a 404). This is demonstrated by the fact that the frontend extension will keep hitting a 404 every 5 seconds if you disable the server extension. As can be seen from the lumino code, we need to raise an exception to trigger the backoff code. Simply returning null doesn't do anything: https://github.com/jupyterlab/lumino/blob/8567deefe4dd2c84b3bd22da5c8151941cd3b2db/packages/polling/src/poll.ts#L319-L329
1 parent 6fa156f commit af1bf58

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/labextension/src/memoryUsage.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,6 @@ namespace Private {
336336
);
337337
const response = await request;
338338

339-
if (response.ok) {
340-
return await response.json();
341-
}
342-
343-
return null;
339+
return await response.json();
344340
}
345341
}

0 commit comments

Comments
 (0)