diff --git a/src/SuperDumpService/Services/DumpRepository.cs b/src/SuperDumpService/Services/DumpRepository.cs index 8238820..d85bd0f 100644 --- a/src/SuperDumpService/Services/DumpRepository.cs +++ b/src/SuperDumpService/Services/DumpRepository.cs @@ -68,7 +68,6 @@ public IEnumerable GetAll() { public async Task CreateDump(string bundleId, FileInfo sourcePath) { DumpMetainfo dumpInfo; string dumpId; - var dict = new ConcurrentDictionary(); dumpId = CreateUniqueDumpId(); dumpInfo = new DumpMetainfo() { BundleId = bundleId, @@ -78,8 +77,8 @@ public async Task CreateDump(string bundleId, FileInfo sourcePath) Created = DateTime.Now, Status = DumpStatus.Created }; - dict[dumpId] = dumpInfo; - dumps.TryAdd(bundleId, dict); + if (!dumps.ContainsKey(bundleId)) dumps[bundleId] = new ConcurrentDictionary(); + dumps[bundleId][dumpId] = dumpInfo; storage.Create(dumpInfo.Id); FileInfo destFile = await storage.AddFileCopy(dumpInfo.Id, sourcePath);