Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/libraries/Downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,10 @@ export function downloadBinary(binaryInfo: BinaryInfo, options: InternalServerOp
let useDownloadsURL = false;

do {
const downloadURL = binaryInfo.hostedByOracle ? `${useDownloadsURL ? MySQLCDNDownloadsBaseURL : MySQLCDNArchivesBaseURL}${url}` : await getFileDownloadURLRedirect(url)
let downloadURL: string = 'UNINITIALISED'
try {
downloadTries++;
downloadURL = binaryInfo.hostedByOracle ? `${useDownloadsURL ? MySQLCDNDownloadsBaseURL : MySQLCDNArchivesBaseURL}${url}` : await getFileDownloadURLRedirect(url)
logger.log(`Starting download for MySQL version ${version} from ${downloadURL}.`)
await downloadFromCDN(downloadURL, archivePath, logger)
logger.log(`Finished downloading MySQL version ${version} from ${downloadURL}. Now starting binary extraction.`)
Expand Down Expand Up @@ -358,14 +359,15 @@ export function downloadBinary(binaryInfo: BinaryInfo, options: InternalServerOp
let useDownloadsURL = false;

do {
const downloadURL = binaryInfo.hostedByOracle ? `${useDownloadsURL ? MySQLCDNDownloadsBaseURL : MySQLCDNArchivesBaseURL}${url}` : await getFileDownloadURLRedirect(url)
let downloadURL: string = 'UNINITIALISED'
const uuid = randomUUID()
const zipFilepath = `${dirpath}/${uuid}.${fileExtension}`
logger.log('Binary filepath:', zipFilepath)
const extractedPath = `${dirpath}/${uuid}`

try {
downloadTries++
downloadURL = binaryInfo.hostedByOracle ? `${useDownloadsURL ? MySQLCDNDownloadsBaseURL : MySQLCDNArchivesBaseURL}${url}` : await getFileDownloadURLRedirect(url)
logger.log(`Starting download for MySQL version ${version} from ${downloadURL}.`)
await downloadFromCDN(downloadURL, zipFilepath, logger)
logger.log(`Finished downloading MySQL version ${version} from ${downloadURL}. Now starting binary extraction.`)
Expand Down