Closed nicolas-raoul closed 10 years ago
SparkleControllerBase have a FileSystemWatcter (watcher object) already implemented. We must work on the OnFolderActivity method. Low priority at this time.
Well spot Yannick!
Current Crawl Method impact hard drive performance with a lot file.
OnFolderActivity in SparkleControllerBase watch only the root folder, not subfolder. We must work on HasRemoteChanges and HasLocalChanges instead. HasLocalChanges could use a FileSystemWatcher and compare with CmisDatabase. but how to detect remote changes without crawl the remote folder
A suggestion that storing the local Last Modify Time and file size to local database. Unless local Last Modify Time or file size is changed, we will not check for SHA1 check sum.
If no one is assigned to this issue, I will try to fix it in OpenDataSpace/CmisSync firstly
The first task will be done, and the second task may be optional
more0401, thanks a lot for stepping in!
Note: I guess implementing ChangeLog is more important (to save network bandwidth and server resources), but FileSystemWatcher is also a nice thing to add, indeed.
Note: Implementation should probably start inside method ControllerBase.OnFolderActivity , and platform-specific code should be written as methods in Controller.cs :-)
I have done the fix, while it may take some time to merge to OpenDataSpace/CmisSync.git You can preview this work from https://github.com/more0401/CmisSync/ branch gds2/issue122
I add a new file CmisSync.Lib/WatcherStrategy.cs that does the work to sync the FileSystemWatcher changes, which is called by CmisSync.Lib,CmisRepo.SynchronizedFolder.Sync() every 5 seconds.
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx
We will still need to crawl when CmisSync is started, and maybe once in a while if we don't trust FileSystemWatcher too much.