Add EnableRetryOnFailure to handle transient connection failures (57P01 terminating connection)
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Model.IO;
|
||||
|
||||
@@ -30,7 +31,22 @@ namespace MediaBrowser.Controller.Providers
|
||||
|
||||
public FileSystemMetadata[] GetFileSystemEntries(string path)
|
||||
{
|
||||
return _cache.GetOrAdd(path, static (p, fileSystem) => fileSystem.GetFileSystemEntries(p).ToArray(), _fileSystem);
|
||||
if (_cache.TryGetValue(path, out var result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
result = _fileSystem.GetFileSystemEntries(path).ToArray();
|
||||
_cache.TryAdd(path, result);
|
||||
return result;
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
// A folder may be deleted between scans; treat it as empty so refresh logic can continue.
|
||||
return Array.Empty<FileSystemMetadata>();
|
||||
}
|
||||
}
|
||||
|
||||
public List<FileSystemMetadata> GetDirectories(string path)
|
||||
|
||||
Reference in New Issue
Block a user