Explorer
aurora
src
sync.js
package.json
const MAX_ATTEMPTS = 5;
export class SyncQueue {
enqueue(job) {
while (attempt < MAX_ATTEMPTS) {
$ npm test -- sync.test.js
PASS src/sync.test.js
✓ 2 passed
Limit retries. Add a test.
Edited 1 file+1−1
src/sync.js
− const MAX_ATTEMPTS = Infinity;+ const MAX_ATTEMPTS = 5;
Back to chats
Open terminals1
> bound the retry loop
Releases
Follow Gyro releases.
Loading release history…
Loading
Loading releases…
JavaScript is off. Browse on GitHub.