Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf07cd13

Browse files
authored
fix: fix retry max-out bug (anuraghazra#2121)
* fix: fix retry max-out bugThis commit makes sure that the retry function tests all PATs.* style: format code* test: fix retry tests* style: format code
1 parent42a4b6f commitf07cd13

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎src/common/retryer.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import{CustomError,logger}from"./utils.js";
22

3+
// Script variables.
4+
constPATs=Object.keys(process.env).filter((key)=>
5+
/PAT_\d*$/.exec(key),
6+
).length;
7+
constRETRIES=PATs ?PATs :7;
8+
39
/**
410
* Try to execute the fetcher function until it succeeds or the max number of retries is reached.
511
*
@@ -10,7 +16,7 @@ import { CustomError, logger } from "./utils.js";
1016
*@returns Promise<retryer>
1117
*/
1218
constretryer=async(fetcher,variables,retries=0)=>{
13-
if(retries>7){
19+
if(retries>RETRIES){
1420
thrownewCustomError("Maximum retries exceeded",CustomError.MAX_RETRY);
1521
}
1622
try{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp