Increase download timeout limit

This commit is contained in:
Geomitron
2024-01-16 09:25:04 -06:00
parent e2a52f25f6
commit 09f19d9e27
3 changed files with 16 additions and 2 deletions

View File

@@ -48,6 +48,7 @@
"sanitize-filename": "^1.6.3",
"scan-chart": "^3.4.1",
"tslib": "^2.0.0",
"undici": "^6.3.0",
"zod": "^3.22.4",
"zone.js": "~0.14.2"
},

11
pnpm-lock.yaml generated
View File

@@ -74,6 +74,9 @@ dependencies:
tslib:
specifier: ^2.0.0
version: 2.6.2
undici:
specifier: ^6.3.0
version: 6.3.0
zod:
specifier: ^3.22.4
version: 3.22.4
@@ -2410,7 +2413,6 @@ packages:
/@fastify/busboy@2.1.0:
resolution: {integrity: sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==}
engines: {node: '>=14'}
dev: true
/@humanwhocodes/config-array@0.11.13:
resolution: {integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==}
@@ -10299,6 +10301,13 @@ packages:
'@fastify/busboy': 2.1.0
dev: true
/undici@6.3.0:
resolution: {integrity: sha512-zkSMOXs2topAR1LF0PxAaNNvhdX4LYEcmRMJLMh3mjgfZpBtc/souXOp4aYiR5Q46HrBPA2/8DkEZhD3eNFE1Q==}
engines: {node: '>=18.0'}
dependencies:
'@fastify/busboy': 2.1.0
dev: false
/unicode-canonical-property-names-ecmascript@2.0.0:
resolution: {integrity: sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==}
engines: {node: '>=4'}

View File

@@ -10,12 +10,15 @@ import { join } from 'path'
import { rimraf } from 'rimraf'
import { Readable } from 'stream'
import { ReadableStream } from 'stream/web'
import { Agent, fetch, setGlobalDispatcher } from 'undici'
import { inspect } from 'util'
import { tempPath } from '../../../src-shared/Paths'
import { sanitizeFilename } from '../../ElectronUtilFunctions'
import { getSettings } from '../SettingsHandler.ipc'
setGlobalDispatcher(new Agent({ connect: { timeout: 60_000 } }))
export interface DownloadMessage {
header: string
body: string
@@ -167,7 +170,8 @@ export class ChartDownload {
})
})
} else {
const sngStream = new SngStream(() => sngResponse.body!, { generateSongIni: true })
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const sngStream = new SngStream(() => sngResponse.body! as any, { generateSongIni: true })
let downloadedByteCount = BigInt(0)
await mkdirp(join(this.tempPath, this.destinationName))