mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 15:17:23 +01:00
change downloads to concurrentdictionary
This commit is contained in:
parent
4a0dce0e44
commit
7265dab8a7
4 changed files with 10 additions and 5 deletions
|
|
@ -95,7 +95,7 @@ namespace MareSynchronos.WebAPI
|
|||
{
|
||||
File.Delete(tempFile);
|
||||
Logger.Debug("Detected cancellation, removing " + currentDownloadId);
|
||||
CurrentDownloads.Remove(currentDownloadId);
|
||||
CancelDownload(currentDownloadId);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -136,7 +136,7 @@ namespace MareSynchronos.WebAPI
|
|||
}
|
||||
|
||||
Logger.Debug("Download complete, removing " + currentDownloadId);
|
||||
CurrentDownloads.Remove(currentDownloadId);
|
||||
CancelDownload(currentDownloadId);
|
||||
}
|
||||
|
||||
public async Task PushCharacterData(CharacterCacheDto character, List<string> visibleCharacterIds)
|
||||
|
|
@ -292,7 +292,10 @@ namespace MareSynchronos.WebAPI
|
|||
|
||||
public void CancelDownload(int downloadId)
|
||||
{
|
||||
CurrentDownloads.Remove(downloadId);
|
||||
while (CurrentDownloads.ContainsKey(downloadId))
|
||||
{
|
||||
CurrentDownloads.TryRemove(downloadId, out _);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue