Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need file size sync also #23

Closed
HaiderAli008 opened this issue Jun 24, 2022 · 6 comments
Closed

Need file size sync also #23

HaiderAli008 opened this issue Jun 24, 2022 · 6 comments

Comments

@HaiderAli008
Copy link

Can you please add in sync feature if the size of file change on amazon then local file also change according to ?

@HaiderAli008
Copy link
Author

Due to network or other reason if video file downloaded partially its not updated next time and video file remain corrupt until delete

@adam-fowler
Copy link
Member

Hi @HaiderAli008 This should be possible. But there is the possibility that this could delete files that are newer on the destination even though they are newer. Is this what you intend?

@HaiderAli008
Copy link
Author

At cloud storage side I need to replace file with some changes that is not synch with local folder because of file already exist and also some time internet issue some file does't download properly and it remain corrupt.

@adam-fowler
Copy link
Member

Hi @HaiderAli008
If I gave you a function that resumed a download that failed would that work for you?

@adam-fowler
Copy link
Member

See PR #33
Code works as follows

// resume failed download
func resume(_ download: S3FileTransferManager.DownloadOperation) async {
    do {
        try await self.s3FileTransfer.resume(download: download)
    } catch {
        if let error = error as? S3FileTransferManager.Error, case .downloadFailed(_, let download) = error {
            await self.resume(download)
        }
    }
}

do {
    try await self.s3FileTransfer.sync(from: self.s3Folder, to: self.localFolder, delete: true)
} catch {
    if let error = error as? S3FileTransferManager.Error, case .downloadFailed(_, let download) = error {
        await self.resume(download)
    }
}

@adam-fowler
Copy link
Member

Closing as I've had no response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants