Commit 214b1d2
⚡ optimize: execute shelf synchronization network calls concurrently
- Fixes sequential N+1 network call scaling by executing user API PUTs concurrently inside a coroutineScope using `async` and `.awaitAll()`.
- Fixes pre-existing logical bug where data was being incorrectly pushed to the logged-in user's shelf URL instead of the respective model's URL (`model._id`).
- Implements a `.chunked(10)` concurrency limit to prevent connection pool exhaustion and overwhelming the server.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent d858a77 commit 214b1d2
1 file changed
Lines changed: 20 additions & 18 deletions
Lines changed: 20 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
369 | 371 | | |
370 | | - | |
371 | | - | |
| 372 | + | |
| 373 | + | |
372 | 374 | | |
373 | 375 | | |
374 | 376 | | |
| |||
0 commit comments