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

@@ -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))