@salesforce/core 8.9.1 → 8.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -65,6 +65,11 @@ export declare namespace PollingClient {
|
|
|
65
65
|
* ```
|
|
66
66
|
*/
|
|
67
67
|
timeoutErrorName?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Maximum number of retries. Use 'INFINITELY' for unlimited retries until timeout is reached.
|
|
70
|
+
* If not specified, defaults to 'INFINITELY'.
|
|
71
|
+
*/
|
|
72
|
+
retryLimit?: number | 'INFINITELY';
|
|
68
73
|
};
|
|
69
74
|
/**
|
|
70
75
|
* Default options set for polling. The default options specify a timeout of 3 minutes and polling frequency of 15
|
|
@@ -76,13 +76,12 @@ class PollingClient extends kit_1.AsyncOptionalCreatable {
|
|
|
76
76
|
}
|
|
77
77
|
throw new Error('Operation did not complete. Retrying...'); // triggers a retry
|
|
78
78
|
};
|
|
79
|
-
const finalResult = (0, ts_retry_promise_1.retryDecorator)(doPoll, {
|
|
80
|
-
timeout: this.options.timeout.milliseconds,
|
|
81
|
-
delay: this.options.frequency.milliseconds,
|
|
82
|
-
retries: 'INFINITELY',
|
|
83
|
-
});
|
|
84
79
|
try {
|
|
85
|
-
return await
|
|
80
|
+
return await (0, ts_retry_promise_1.retryDecorator)(doPoll, {
|
|
81
|
+
timeout: this.options.timeout.milliseconds,
|
|
82
|
+
delay: this.options.frequency.milliseconds,
|
|
83
|
+
retries: this.options.retryLimit ?? 'INFINITELY',
|
|
84
|
+
})();
|
|
86
85
|
}
|
|
87
86
|
catch (error) {
|
|
88
87
|
if (errorInPollingFunction) {
|