1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

updates static resourceprovider with better logging.

This commit is contained in:
kay.one 2013-05-19 18:07:26 -07:00
parent 6fc8ec6cbc
commit 43b4262e14
3 changed files with 12 additions and 13 deletions

View File

@ -35,20 +35,20 @@ public Response ProcessStaticResourceRequest(NancyContext context, string workin
return null;
}
foreach (var requestMapper in _requestMappers)
{
if (requestMapper.CanHandle(path))
{
var filePath = requestMapper.Map(path);
var mapper = _requestMappers.SingleOrDefault(m => m.CanHandle(path));
if (_diskProvider.FileExists(filePath))
{
return new StreamResponse(() => File.OpenRead(filePath), MimeTypes.GetMimeType(filePath));
}
if (mapper != null)
{
var filePath = mapper.Map(path);
if (_diskProvider.FileExists(filePath))
{
return new StreamResponse(() => File.OpenRead(filePath), MimeTypes.GetMimeType(filePath));
}
_logger.Warn("File {0} not found", filePath);
}
_logger.Warn("Couldn't find a matching file for: {0}", path);
return null;
}
}

View File

@ -81,6 +81,8 @@ private void InstallUpdate(UpdatePackage updatePackage)
var process = _processProvider.Start(startInfo);
_processProvider.WaitForExit(process);
_logger.Error("Update process failed");
}
public Dictionary<DateTime, string> GetUpdateLogFiles()

View File

@ -81,9 +81,6 @@ public virtual void Start(string targetFolder)
try
{
_diskProvider.CopyDirectory(_environmentProvider.GetUpdatePackageFolder(), targetFolder);
logger.Trace("Deleting Update Package.");
_diskProvider.DeleteFolder(_environmentProvider.GetUpdatePackageFolder(), true);
}
catch (Exception e)
{