Skip to content

Commit 328b9de

Browse files
committed
fix: improve loading queue and the retry logic
1 parent fff5500 commit 328b9de

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
.DS_Store
44
Thumbs.db
55
*.log
6-
node_modules/
6+
node_modules/
7+
dist/

.releaserc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"CONTRIBUTIONS.md",
1717
"README.md",
1818
"docs/**/*",
19-
"example/**/*",
20-
"dist/**/*"
19+
"example/**/*"
2120
],
2221
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
2322
}],

src/fanos.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export class Fanos {
134134

135135
const maxDelay = this.config.maxRetryDelay || 300000
136136
const delay = Math.min(
137-
this.config.retryInterval * 2 ** (attempt - 1),
137+
this.config.retryInterval * 2 ** (attempt - 1) * (1 + Math.random() * 0.2),
138138
maxDelay,
139139
)
140140

@@ -181,7 +181,8 @@ export class Fanos {
181181
}
182182
} catch (error) {
183183
debugLog(this.config.debug, 'Error loading queue:', error)
184-
this.queue.clear()
184+
this.queue.clear();
185+
localStorage.removeItem(this.config.storeKey);
185186
}
186187
}
187188

0 commit comments

Comments
 (0)