Skip to content

Commit

Permalink
Fixes as per PR review --ECL
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkidu93 committed Sep 8, 2023
1 parent 4513ee7 commit d13f0e0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/SIL.Machine.AspNetCore/Services/S3FileStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public override async Task<Stream> OpenWrite(string path, CancellationToken canc
InitiateMultipartUploadResponse response = await _client.InitiateMultipartUploadAsync(request);
return new BufferedStream(
new S3WriteStream(_client, objectId, _bucketName, response.UploadId, _loggerFactory),
S3WriteStream.FiveMB
S3WriteStream.MaxPartSize
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/SIL.Machine.AspNetCore/Services/S3WriteStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class S3WriteStream : Stream
private readonly List<UploadPartResponse> _uploadResponses;
private readonly ILogger<S3WriteStream> _logger;

public const int FiveMB = 5 * 1024 * 1024;
public const int MaxPartSize = 5 * 1024 * 1024;

public S3WriteStream(
AmazonS3Client client,
Expand Down Expand Up @@ -67,7 +67,7 @@ public override async Task WriteAsync(byte[] buffer, int offset, int count, Canc
UploadId = _uploadId,
PartNumber = partNumber,
InputStream = ms,
PartSize = FiveMB
PartSize = MaxPartSize
};
request.StreamTransferProgress += new EventHandler<StreamTransferProgressArgs>(
(_, e) =>
Expand Down
4 changes: 1 addition & 3 deletions src/SIL.Machine.AspNetCore/Services/SharedFileService.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using SIL.Reporting;

namespace SIL.Machine.AspNetCore.Services;
namespace SIL.Machine.AspNetCore.Services;

public class SharedFileService : ISharedFileService
{
Expand Down

0 comments on commit d13f0e0

Please sign in to comment.