Commit e607dbf
committed
feat(shared): add configurable delay to ThrottledFetchingService
Enhances the `ThrottledFetchingService` to be a better API citizen by introducing a configurable delay between sequential page fetches.
- Adds a `delayBetweenRequests` parameter to the `fetchAll` method with a default of 200ms.
- Implements `Future.delayed` within the pagination loop to throttle requests.
- Removes the unused `batchSize` parameter to clean up the method signature.
This prevents overwhelming the server with rapid-fire requests when fetching a large number of pages.1 parent f33e7ae commit e607dbf
File tree
1 file changed
+10
-4
lines changed1 file changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| |||
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | | - | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
29 | | - | |
30 | | - | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | | - | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| |||
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
| |||
0 commit comments