aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/IO/FileRefresher.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-06-11 11:56:15 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-06-11 11:56:15 -0400
commitdc5c15c60b598a58c924daa350dfaf9f6b7d1c17 (patch)
treec643c0f4604ed939c1261c2016f0a9be121db8d3 /MediaBrowser.Server.Implementations/IO/FileRefresher.cs
parent4c7f292ba884c16b9e95eb319f3664469189d22c (diff)
update elements
Diffstat (limited to 'MediaBrowser.Server.Implementations/IO/FileRefresher.cs')
-rw-r--r--MediaBrowser.Server.Implementations/IO/FileRefresher.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/IO/FileRefresher.cs b/MediaBrowser.Server.Implementations/IO/FileRefresher.cs
index 18c52ab29..4bea6ad34 100644
--- a/MediaBrowser.Server.Implementations/IO/FileRefresher.cs
+++ b/MediaBrowser.Server.Implementations/IO/FileRefresher.cs
@@ -93,8 +93,15 @@ namespace MediaBrowser.Server.Implementations.IO
private async void OnTimerCallback(object state)
{
+ List<string> paths;
+
+ lock (_timerLock)
+ {
+ paths = _affectedPaths.ToList();
+ }
+
// Extend the timer as long as any of the paths are still being written to.
- if (_affectedPaths.Any(IsFileLocked))
+ if (paths.Any(IsFileLocked))
{
Logger.Info("Timer extended.");
RestartTimer();
@@ -108,7 +115,7 @@ namespace MediaBrowser.Server.Implementations.IO
try
{
- await ProcessPathChanges(_affectedPaths.ToList()).ConfigureAwait(false);
+ await ProcessPathChanges(paths.ToList()).ConfigureAwait(false);
}
catch (Exception ex)
{