Skip to content

Commit

Permalink
Revert "fix(s3): cleanup file cache after mpu task is cancelled (#5128)"
Browse files Browse the repository at this point in the history
This reverts commit a0afc64.
  • Loading branch information
harsh62 committed Jul 15, 2024
1 parent d679437 commit d61eb55
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
3 changes: 1 addition & 2 deletions AWSS3/AWSS3TransferUtility.m
Original file line number Diff line number Diff line change
Expand Up @@ -1158,8 +1158,7 @@ - (void) retryUpload: (AWSS3TransferUtilityUploadTask *) transferUtilityUploadTa
transferUtilityMultiPartUploadTask.retryCount = 0;
transferUtilityMultiPartUploadTask.temporaryFileCreated = temporaryFileCreated;
transferUtilityMultiPartUploadTask.status = AWSS3TransferUtilityTransferStatusInProgress;
transferUtilityMultiPartUploadTask.cachedFileURL = fileURL;


//Get the size of the file and calculate the number of parts.
NSError *nsError = nil;
NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[fileURL path]
Expand Down
9 changes: 0 additions & 9 deletions AWSS3/AWSS3TransferUtilityTasks.m
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,6 @@ - (void)cancel {
}

[AWSS3TransferUtilityDatabaseHelper deleteTransferRequestFromDB:self.transferID databaseQueue:self.databaseQueue];

NSString *path = self.cachedFileURL.path;
if (path && [[NSFileManager defaultManager] fileExistsAtPath:path]) {
NSError *error = nil;
[[NSFileManager defaultManager] removeItemAtPath:path error:&error];
if (error) {
AWSDDLogError(@"Error deleting file[%@]: [%@]", path, error);
}
}
}

- (void)resume {
Expand Down
1 change: 0 additions & 1 deletion AWSS3/AWSS3TransferUtility_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
@property (copy) NSString * uploadID;
@property BOOL cancelled;
@property BOOL temporaryFileCreated;
@property NSURL *cachedFileURL;
@property NSMutableDictionary <NSNumber *, AWSS3TransferUtilityUploadSubTask *> *waitingPartsDictionary;
@property (strong, nonatomic) NSMutableSet <AWSS3TransferUtilityUploadSubTask *> *completedPartsSet;
@property (strong, nonatomic) NSMutableDictionary <NSNumber *, AWSS3TransferUtilityUploadSubTask *> *inProgressPartsDictionary;
Expand Down

0 comments on commit d61eb55

Please sign in to comment.