update elements

This commit is contained in:
Luke Pulverenti
2016-06-11 11:56:15 -04:00
parent 4c7f292ba8
commit dc5c15c60b
8 changed files with 198 additions and 184 deletions

View File

@@ -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)
{