1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-06 09:19:22 +02:00

Merge remote-tracking branch 'origin/release-3.0' into dev

This commit is contained in:
Henry Heino
2024-08-15 08:34:56 -07:00
2 changed files with 9 additions and 4 deletions

View File

@@ -590,6 +590,7 @@ function shimInit(options: ShimInitOptions = null) {
cleanUpOnError(error);
});
const requestStart = new Date();
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
const request = http.request(requestOptions, (response: any) => {
@@ -629,7 +630,10 @@ function shimInit(options: ShimInitOptions = null) {
});
request.on('timeout', () => {
request.destroy(new Error(`Request timed out. Timeout value: ${requestOptions.timeout}ms.`));
// We choose to not destroy the request when a timeout value is not specified to keep
// the behavior we had before the addition of this event handler.
if (!requestOptions.timeout) return;
request.destroy(new Error(`Request timed out. Timeout value: ${requestOptions.timeout}ms. Actual connection time: ${new Date().getTime() - requestStart.getTime()}ms`));
});
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied