fix directory watchers not picking up changes

This commit is contained in:
Luke Pulverenti
2013-11-26 21:38:11 -05:00
parent 9f5fbfa855
commit 64818ebd22
9 changed files with 59 additions and 23 deletions

View File

@@ -69,7 +69,7 @@ namespace MediaBrowser.Server.Implementations.IO
// This is an arbitraty amount of time, but delay it because file system writes often trigger events after RemoveTempIgnore has been called.
// Seeing long delays in some situations, especially over the network.
// Seeing delays up to 40 seconds, but not going to ignore changes for that long.
await Task.Delay(20000).ConfigureAwait(false);
await Task.Delay(1500).ConfigureAwait(false);
string val;
_tempIgnoredPaths.TryRemove(path, out val);

View File

@@ -905,6 +905,20 @@ namespace MediaBrowser.Server.Implementations.Library
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
public async Task ValidateMediaLibraryInternal(IProgress<double> progress, CancellationToken cancellationToken)
{
_directoryWatchersFactory().Stop();
try
{
await PerformLibraryValidation(progress, cancellationToken).ConfigureAwait(false);
}
finally
{
_directoryWatchersFactory().Start();
}
}
private async Task PerformLibraryValidation(IProgress<double> progress, CancellationToken cancellationToken)
{
_logger.Info("Validating media library");

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace MediaBrowser.Server.Implementations.LiveTv
{
class RefreshChannelsScheduledTask : IScheduledTask
class RefreshChannelsScheduledTask
{
private readonly ILiveTvManager _liveTvManager;