Callback during sync for Hazaar\File\Dir #203
Labels
No labels
bug
confirmed
critical
discussion
documentation
Doing
enhancement
experiment
suggestion
support
Testing
To Do
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: hazaar/framework#203
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The
Hazaar\File\Dir
class has async
function that will sync files from one directory to another. This works across media backends as well. Because of this, the process an take some time and may be prone to communications errors on remote storage backends such as Dropbox and SharePoint.Solution
To help eleviate these issues and allow a bit more customisation when using the sync function, I would like to be able to supply a callback function as an argument. This callback is triggered for various events such as file copy start/finish, dir copy start/finish and any errors. The callback can also be passed the source/target file/directory as well as the exception/error that occurred. The reason we wouldn't want to throw an exception internally is because we may want to carry on copying files even if an error occurs, or even get the sync to retry.
Returns
true
,null
orvoid
- Everything is fine and the sync should carry on.false
- Then the sync did something wrong and should retry.created merge request !96 to address this issue
mentioned in merge request !96
mentioned in commit c3634dffbb3e4645423f28b9f90d4d6dc48cb374