diff --git a/Tests/ArmoniK.EndToEndTests/ArmoniK.EndToEndTests.Common/ArmoniK.EndToEndTests.Common.csproj b/Tests/ArmoniK.EndToEndTests/ArmoniK.EndToEndTests.Common/ArmoniK.EndToEndTests.Common.csproj index 3517fe90e..1a4ad10f7 100644 --- a/Tests/ArmoniK.EndToEndTests/ArmoniK.EndToEndTests.Common/ArmoniK.EndToEndTests.Common.csproj +++ b/Tests/ArmoniK.EndToEndTests/ArmoniK.EndToEndTests.Common/ArmoniK.EndToEndTests.Common.csproj @@ -18,7 +18,7 @@ - + diff --git a/Worker/src/Common/Adapter/S3Adapter.cs b/Worker/src/Common/Adapter/S3Adapter.cs index 0a265abcd..f0a0f419d 100644 --- a/Worker/src/Common/Adapter/S3Adapter.cs +++ b/Worker/src/Common/Adapter/S3Adapter.cs @@ -103,8 +103,10 @@ public async Task DownloadFileAsync(string fileName) }); var stream2 = new BufferedStream(r.ResponseStream); + var materializedFileName = fileName + Guid.NewGuid(); + var file = new FileStream(Path.Combine(LocalZipDir, - fileName), + materializedFileName), FileMode.Create, FileAccess.Write); try @@ -133,5 +135,10 @@ public async Task DownloadFileAsync(string fileName) throw new Exception("Error occurred: " + amazonS3Exception.Message); } + + File.Move(Path.Combine(LocalZipDir, + materializedFileName), + Path.Combine(LocalZipDir, + fileName)); } }