Add logs for part upload

This commit is contained in:
Neeraj Gupta 2024-05-08 11:37:37 +05:30
parent 27aaf98c4d
commit 34ea7749ab
2 changed files with 5 additions and 1 deletions

View file

@ -187,7 +187,9 @@ class MultiPartUploader {
final isLastPart = i == partsLength - 1; final isLastPart = i == partsLength - 1;
final fileSize = final fileSize =
isLastPart ? encryptedFile.lengthSync() % partSize : partSize; isLastPart ? encryptedFile.lengthSync() % partSize : partSize;
_logger.info(
"Uploading part ${i + 1} / $partsLength of size $fileSize bytes (total size ${encryptedFile.lengthSync()}).",
);
final response = await _s3Dio.put( final response = await _s3Dio.put(
partURL, partURL,
data: encryptedFile.openRead( data: encryptedFile.openRead(

View file

@ -1,6 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'dart:collection'; import 'dart:collection';
import 'dart:convert'; import 'dart:convert';
import "dart:developer" as dev;
import 'dart:io'; import 'dart:io';
import 'dart:math' as math; import 'dart:math' as math;
@ -576,6 +577,7 @@ class FileUploader {
final fileUploadURL = await _getUploadURL(); final fileUploadURL = await _getUploadURL();
fileObjectKey = await _putFile(fileUploadURL, encryptedFile); fileObjectKey = await _putFile(fileUploadURL, encryptedFile);
} else { } else {
dev.log("Init multipartUpload $multipartEntryExists", name: "Uploader");
if (multipartEntryExists) { if (multipartEntryExists) {
fileObjectKey = await _multiPartUploader.putExistingMultipartFile( fileObjectKey = await _multiPartUploader.putExistingMultipartFile(
encryptedFile, encryptedFile,