Skip to content

Commit 4e6bff1

Browse files
committed
feat: improve multizip
1 parent 47d41c1 commit 4e6bff1

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

src/ByteSync.Client/Business/Synchronizations/MultiUploadZip.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public MultiUploadZip(string key, SharedFileDefinition sharedFileDefinition)
1212
Key = key;
1313

1414
SharedFileDefinition = sharedFileDefinition;
15-
// ZipPath = zipPath;
1615

1716
SharedFileDefinition.IsMultiFileZip = true;
1817
CreationDate = DateTime.Now;
@@ -21,8 +20,6 @@ public MultiUploadZip(string key, SharedFileDefinition sharedFileDefinition)
2120
MemoryStream = new MemoryStream();
2221

2322
ZipArchive = new ZipArchive(MemoryStream, ZipArchiveMode.Create, true);
24-
25-
// ZipArchive = ZipFile.Open(zipPath, ZipArchiveMode.Update);
2623

2724
ActionGroupsIds = new List<string>();
2825

@@ -35,8 +32,6 @@ public MultiUploadZip(string key, SharedFileDefinition sharedFileDefinition)
3532

3633
public SharedFileDefinition SharedFileDefinition { get; }
3734

38-
// public string ZipPath { get; }
39-
4035
public MemoryStream MemoryStream { get; }
4136

4237
public ZipArchive ZipArchive { get; }
@@ -54,7 +49,7 @@ public MultiUploadZip(string key, SharedFileDefinition sharedFileDefinition)
5449
public bool CanAdd(FileInfo fileInfo, string actionsGroupId)
5550
{
5651
return
57-
ActionGroupsIds.Count < 50 &&
52+
ActionGroupsIds.Count < 100 &&
5853
ActionsGroupIdsConcatenationLength + actionsGroupId.Length + 5 < 25000 &&
5954
Size + fileInfo.Length < 8 * SizeConstants.ONE_MEGA_BYTES;
6055
}

src/ByteSync.Client/Services/Synchronizations/SynchronizationActionRemoteUploader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public Task Abort()
203203

204204
private bool IsFileUploadableWithMultiUpload(FileInfo fileInfo)
205205
{
206-
return fileInfo.Length <= 200 * SizeConstants.ONE_KILO_BYTES;
206+
return fileInfo.Length <= 250 * SizeConstants.ONE_KILO_BYTES;
207207
}
208208

209209
private async Task CloseAndUploadCurrentMultiZip()

0 commit comments

Comments
 (0)