@salesforce/core 8.9.0 → 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.
|
@@ -29,7 +29,7 @@ function default_1() {
|
|
|
29
29
|
cb();
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
|
-
//
|
|
32
|
+
// Set up pipeline with proper error handling
|
|
33
33
|
(0, node_stream_1.pipeline)(source, myTransportStream, () => { });
|
|
34
34
|
return myTransportStream;
|
|
35
35
|
}, {
|
|
@@ -37,21 +37,20 @@ function default_1() {
|
|
|
37
37
|
enablePipelining: true,
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
// Cache for debug regex to avoid recreating it on every message
|
|
41
|
+
let cachedDebugRegex = null;
|
|
42
|
+
let lastDebugPattern = null;
|
|
41
43
|
const debugAllows = (chunk) => {
|
|
42
44
|
if (!process.env.DEBUG || process.env.DEBUG === '*')
|
|
43
45
|
return true;
|
|
44
46
|
if (typeof chunk.name !== 'string')
|
|
45
47
|
return true;
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
// console.log(`match : ${chunk.name} for ${process.env.DEBUG}`);
|
|
54
|
-
return true;
|
|
48
|
+
// Only create a new regex if the DEBUG pattern has changed
|
|
49
|
+
if (process.env.DEBUG !== lastDebugPattern) {
|
|
50
|
+
lastDebugPattern = process.env.DEBUG;
|
|
51
|
+
cachedDebugRegex = new RegExp(process.env.DEBUG.replace(/\*/g, '.*'));
|
|
55
52
|
}
|
|
53
|
+
// Use the cached regex for pattern matching
|
|
54
|
+
return cachedDebugRegex.test(chunk.name);
|
|
56
55
|
};
|
|
57
56
|
//# sourceMappingURL=transformStream.js.map
|
|
@@ -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) {
|