From 97d65296c4cc85ad62e0cd11e430bdf9d3b1b160 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 5 Dec 2019 18:12:50 +0200 Subject: Improved PPC cdn integration... --- .../MachineSetup/MachineSetupManager.cs | 38 +++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs index cce6c32ab..10418fdcb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineSetup/MachineSetupManager.cs @@ -249,29 +249,29 @@ namespace Tango.PPC.Common.MachineSetup LogManager.Log("Downloading software package..."); - AutoFileDownloader downloader = new AutoFileDownloader(setup_response.BlobAddress, setup_response.CdnAddress, tempFile); - await downloader.ResolveMode(); - - if (downloader.Mode == AutoFileDownloader.DownloadMode.Standard) - { - LogManager.Log($"Connecting to storage CDN with address {downloader.Address}"); - } - else + using (AutoFileDownloader downloader = new AutoFileDownloader(setup_response.BlobAddress, setup_response.CdnAddress, tempFile)) { - LogManager.Log($"Connecting to storage blob with address {downloader.Address}"); - } + await downloader.ResolveMode(); - downloader.Progress += (x, e) => - { - UpdateProgress("Downloading software package", "Downloading...", false, e.Current, e.Total); - }; + if (downloader.Mode == AutoFileDownloader.DownloadMode.Standard) + { + LogManager.Log($"Connecting to storage CDN with address {downloader.Address}"); + } + else + { + LogManager.Log($"Connecting to storage blob with address {downloader.Address}"); + } - var size = await downloader.GetFileSize(); - LogManager.Log("Download size: " + size + " bytes."); - LogManager.Log("Starting file download..."); - await downloader.Download(); + downloader.Progress += (x, e) => + { + UpdateProgress("Downloading software package", "Downloading...", false, e.Current, e.Total); + }; - downloader.Dispose(); + var size = await downloader.GetFileSize(); + LogManager.Log("Download size: " + size + " bytes."); + LogManager.Log("Starting file download..."); + await downloader.Download(); + } UpdateProgress("Downloading software package", "Extracting package..."); -- cgit v1.3.1