Skip to content

Commit c2e8aee

Browse files
committed
CR
1 parent 3be68c0 commit c2e8aee

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/utils.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ class Utils {
828828
}
829829
/**
830830
* Checks if the header image is accessible via the internet.
831-
* saves the result in a static variable to avoid multiple checks.
831+
* Saves the result in a static variable to avoid multiple checks.
832832
* @private
833833
*/
834834
static isHeaderPngAccessible() {
@@ -839,8 +839,9 @@ class Utils {
839839
const url = this.MARKDOWN_HEADER_PNG_URL;
840840
const httpClient = new http_client_1.HttpClient();
841841
try {
842+
// Set timeout to 5 seconds
842843
const requestOptions = {
843-
socketTimeout: 5000, // Set timeout to 5 seconds
844+
socketTimeout: 5000,
844845
};
845846
const response = yield httpClient.head(url, requestOptions);
846847
this.isSummaryHeaderAccessible = response.message.statusCode === 200;
@@ -865,7 +866,6 @@ class Utils {
865866
return tempDir;
866867
}
867868
}
868-
exports.Utils = Utils;
869869
// eslint-disable-next-line @typescript-eslint/no-var-requires
870870
Utils.USER_AGENT = 'setup-jfrog-cli-github-action/' + require('../package.json').version;
871871
// Default artifactory URL and repository for downloading JFrog CLI
@@ -931,3 +931,4 @@ Utils.CUSTOM_SERVER_ID = 'custom-server-id';
931931
Utils.MARKDOWN_HEADER_PNG_URL = 'https://media.jfrog.com/wp-content/uploads/2024/09/02161430/jfrog-job-summary.svg';
932932
// Flag to indicate if the summary header is accessible, can be undefined if not checked yet.
933933
Utils.isSummaryHeaderAccessible = undefined;
934+
exports.Utils = Utils;

src/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ export class Utils {
916916

917917
/**
918918
* Checks if the header image is accessible via the internet.
919-
* saves the result in a static variable to avoid multiple checks.
919+
* Saves the result in a static variable to avoid multiple checks.
920920
* @private
921921
*/
922922
private static async isHeaderPngAccessible(): Promise<boolean> {
@@ -926,8 +926,9 @@ export class Utils {
926926
const url: string = this.MARKDOWN_HEADER_PNG_URL;
927927
const httpClient: HttpClient = new HttpClient();
928928
try {
929+
// Set timeout to 5 seconds
929930
const requestOptions: OutgoingHttpHeaders = {
930-
socketTimeout: 5000, // Set timeout to 5 seconds
931+
socketTimeout: 5000,
931932
};
932933
const response: HttpClientResponse = await httpClient.head(url, requestOptions);
933934
this.isSummaryHeaderAccessible = response.message.statusCode === 200;

0 commit comments

Comments
 (0)