aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-07-05 12:47:10 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-07-05 12:47:10 -0400
commit6ad5c9fa71e6a74deb21850d7632d914e2f2977a (patch)
tree29cb581e990c4750ce63fac9af77fa102e35a32a
parent014f2949d714457e1c987383e59263d68c08063c (diff)
put a slight delay on directory watchers RemoveTempIgnore
-rw-r--r--MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs b/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs
index b95921168..5feb7b4b6 100644
--- a/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs
+++ b/MediaBrowser.Server.Implementations/IO/DirectoryWatchers.cs
@@ -61,8 +61,11 @@ namespace MediaBrowser.Server.Implementations.IO
/// Removes the temp ignore.
/// </summary>
/// <param name="path">The path.</param>
- public void RemoveTempIgnore(string path)
+ public async void RemoveTempIgnore(string path)
{
+ // This is an arbitraty amount of time, but delay it because file system writes often trigger events after RemoveTempIgnore has been called.
+ await Task.Delay(500).ConfigureAwait(false);
+
string val;
_tempIgnoredPaths.TryRemove(path, out val);
}
@@ -358,7 +361,7 @@ namespace MediaBrowser.Server.Implementations.IO
return;
}
- Logger.Info("Watcher sees change of type " + e.ChangeType.ToString() + " to " + e.FullPath);
+ Logger.Info("Watcher sees change of type " + e.ChangeType + " to " + e.FullPath);
//Since we're watching created, deleted and renamed we always want the parent of the item to be the affected path
var affectedPath = e.FullPath;