repo: Make sure there is always only one buffer/sync thread on file activity. Closes #982
This commit is contained in:
parent
0286060d9a
commit
1c156b5e5d
|
@ -209,23 +209,26 @@ namespace SparkleLib {
|
|||
}
|
||||
|
||||
|
||||
private Object buffer_lock = new Object ();
|
||||
|
||||
public void OnFileActivity (FileSystemEventArgs args)
|
||||
{
|
||||
if (IsBuffering)
|
||||
return;
|
||||
|
||||
ChangesDetected ();
|
||||
string relative_path = args.FullPath.Replace (LocalPath, "");
|
||||
|
||||
foreach (string exclude_path in ExcludePaths) {
|
||||
if (relative_path.Contains (exclude_path))
|
||||
if (args.FullPath.Contains (exclude_path))
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsBuffering || !HasLocalChanges)
|
||||
return;
|
||||
lock (this.buffer_lock) {
|
||||
if (IsBuffering || !HasLocalChanges)
|
||||
return;
|
||||
|
||||
IsBuffering = true;
|
||||
IsBuffering = true;
|
||||
}
|
||||
|
||||
ChangesDetected ();
|
||||
|
||||
if (!UseCustomWatcher)
|
||||
this.watcher.Disable ();
|
||||
|
|
Loading…
Reference in a new issue