Skip to content

Commit 810ee42

Browse files
committed
Optional 429 code for NPM
1 parent 03390d4 commit 810ee42

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

scripts/check-urls.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,9 @@ class Curl:
3535
"http://schemas.android.com/tools": (Curl.COULDNT_RESOLVE_HOST, None),
3636
"https://api.aspose.cloud/connect/token": (Curl.HTTP_RETURNED_ERROR, 400),
3737
"https://api.aspose.cloud/v3.0": (Curl.HTTP_RETURNED_ERROR, 403),
38-
"https://mvnrepository.com/artifact/io.swagger/swagger-codegen-cli": (
39-
Curl.HTTP_RETURNED_ERROR,
40-
403,
41-
),
42-
"https://barcode.qa.aspose.cloud/v3.0/barcode/swagger/spec": (
43-
Curl.COULDNT_RESOLVE_HOST,
44-
None,
45-
),
38+
"https://barcode.qa.aspose.cloud/v3.0/barcode/swagger/spec": (Curl.COULDNT_RESOLVE_HOST, None),
39+
"https://mvnrepository.com/artifact/io.swagger/swagger-codegen-cli": (Curl.HTTP_RETURNED_ERROR, 403),
40+
"https://www.npmjs.com/package/aspose-barcode-cloud-node": (Curl.HTTP_RETURNED_ERROR, 429),
4641
# TODO: Temporary fix
4742
"https://dashboard.aspose.cloud/applications": (Curl.HTTP_RETURNED_ERROR, 404),
4843
}
@@ -162,7 +157,7 @@ def create_new_task(url) -> Task:
162157
def process_finished_task(task) -> None:
163158
# print("Finish task:", task.url)
164159
expected_ret_code, expected_http_code = CURL_EXIT_CODES_AND_HTTP_CODES.get(task.url, (0, None))
165-
if task.ret_code == expected_ret_code:
160+
if task.ret_code == 0 or task.ret_code == expected_ret_code:
166161
print("OK:", "'%s' %.2fs" % (task.url, task.age))
167162
JOB_SUMMARY.add_success(task.url)
168163
return

scripts/github_job_summary.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def __init__(self, filename: str):
1313
1414
:param filename: Use $GITHUB_STEP_SUMMARY inside GitHub
1515
"""
16-
self.__file: TextIO = open(filename, mode="wt")
16+
self.__file: TextIO = open(filename, mode="wt", newline="\n")
1717
self._errors = []
1818
self._success = []
1919
self._lock = Lock()
@@ -30,7 +30,7 @@ def __str__(self) -> str:
3030

3131
def _write_line(self, line):
3232
with self._lock:
33-
self.__file.write(line)
33+
self.__file.write(line.replace('\r', ''))
3434

3535
@property
3636
def has_errors(self) -> bool:

0 commit comments

Comments
 (0)