Skip to content

Commit 593ad12

Browse files
authored
Increase retry timeout (#46)
* Increase retry timeout Previously the progression looked like this: - 1st timeout = 3s - 2nd timeout = 4.3s - 3rd timeout = 10.5s - 4th timeout = 14.6s - 5th timeout = 19.4s - Total of all timeouts = 52s Now the progression looks like this: - 1st timeout = 5s - 2nd timeout = 8s - 3rd timeout = 13s - 4th timeout = 20s - 5th timeout = 29s - Total of all timeouts = 75s * Bump version to 0.1.22
1 parent efc50b2 commit 593ad12

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# changelog
22

3+
## 0.1.22
4+
5+
* Increase agent and widget timeouts
6+
37
## 0.1.21
48

59
* Improve performance by throttling stack trace generation.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@friendlycaptcha/sdk",
3-
"version": "0.1.21",
3+
"version": "0.1.22",
44
"description": "In-browser SDK for Friendly Captcha v2",
55
"main": "dist/sdk.js",
66
"type": "module",

src/sdk/sdk.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ export class FriendlyCaptchaSDK {
289289
* @internal
290290
*/
291291
private getRetryTimeout(retryLoadCounter: number) {
292-
return Math.pow(retryLoadCounter, 1.8) * 1000 + 2000;
292+
// 1st timeout = 5 secs, 5th timeout = 29 secs, sum of all timeouts = 75 secs
293+
return Math.pow(retryLoadCounter, 2) * 1000 + 4000;
293294
}
294295

295296
/**

0 commit comments

Comments
 (0)