AnsweredAssumed Answered

Problems cancelling DownloadPreplannedOfflineMapJob

Question asked by matthew.pierce on Jun 27, 2018
Latest reply on Jun 29, 2018 by akajanus-esristaff

I am having problems when I try to cancel an Esri.ArcGISRuntime.Tasks.Offline.DownloadPreplannedOfflineMapJob by calling myJob.Cancel() on my download job instance:


The first is that although the job itself is cancelled, any individual downloads (i.e. tpk and gdb files) that were previously started continue to run until completion. There will be cases where this will involve large downloads (upwards of 20GB), so preventing them from unnecessarily filling up disk space is paramount. I have yet to find a way to stop these downloads outside of stopping the app itself.


The other issue, which only exacerbates the first, is that I am unable to get access to the file handles for these downloaded items in order to delete the downloads (an exception is thrown indicating they are being used by another process), unless and until I restart my app. This adds unwanted complexity: If I know that I no longer want the resources, I want to be able to remove them immediately.


Are there any current workarounds for these issues? Any plans to enhance this behavior in future releases? Thanks.