Skip to content

Commit d9b6328

Browse files
committed
removing static function
1 parent a21daaf commit d9b6328

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

browserstack-report-action/dist/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38805,17 +38805,19 @@ class TimeManager {
3880538805

3880638806
checkTimeout() {
3880738807
if (Date.now() - this.startTime >= this.timeoutMs) {
38808-
throw new Error(`Operation timed out after ${this.timeoutMs / 1000} seconds`);
38808+
return true;
3880938809
}
38810+
return false;
3881038811
}
3881138812

3881238813
/**
3881338814
* Sleep for specified seconds
3881438815
* @param {number} seconds - Number of seconds to sleep
3881538816
* @returns {Promise} - Promise that resolves after the specified time
3881638817
*/
38817-
static async sleep(seconds) {
38818-
return new Promise((resolve) => setTimeout(resolve, seconds * 1000));
38818+
async sleep(seconds) {
38819+
this.pollingInterval = seconds;
38820+
return new Promise((resolve) => setTimeout(resolve, this.pollingInterval * 1000));
3881938821
}
3882038822
}
3882138823

browserstack-report-action/src/utils/TimeManager.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ class TimeManager {
66

77
checkTimeout() {
88
if (Date.now() - this.startTime >= this.timeoutMs) {
9-
throw new Error(`Operation timed out after ${this.timeoutMs / 1000} seconds`);
9+
return true;
1010
}
11+
return false;
1112
}
1213

1314
/**
1415
* Sleep for specified seconds
1516
* @param {number} seconds - Number of seconds to sleep
1617
* @returns {Promise} - Promise that resolves after the specified time
1718
*/
18-
static async sleep(seconds) {
19-
return new Promise((resolve) => setTimeout(resolve, seconds * 1000));
19+
async sleep(seconds) {
20+
this.pollingInterval = seconds;
21+
return new Promise((resolve) => setTimeout(resolve, this.pollingInterval * 1000));
2022
}
2123
}
2224

0 commit comments

Comments
 (0)