update upgrade process

This commit is contained in:
Luke Pulverenti 2016-02-03 16:56:00 -05:00
parent 493662d67d
commit 07cfac913b
2 changed files with 25 additions and 3 deletions

View File

@ -266,11 +266,19 @@ namespace MediaBrowser.Server.Implementations.HttpServer
{".html", 0} {".html", 0}
}; };
private bool EnableLogging(string url) private bool EnableLogging(string url, string localPath)
{ {
var extension = GetExtension(url); var extension = GetExtension(url);
return string.IsNullOrWhiteSpace(extension) || !_skipLogExtensions.ContainsKey(extension); if (string.IsNullOrWhiteSpace(extension) || !_skipLogExtensions.ContainsKey(extension))
{
if (string.IsNullOrWhiteSpace(localPath) || localPath.IndexOf("system/ping", StringComparison.OrdinalIgnoreCase) == -1)
{
return true;
}
}
return false;
} }
private string GetExtension(string url) private string GetExtension(string url)
@ -296,7 +304,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
var localPath = url.LocalPath; var localPath = url.LocalPath;
var urlString = url.OriginalString; var urlString = url.OriginalString;
var enableLog = EnableLogging(urlString); var enableLog = EnableLogging(urlString, localPath);
if (enableLog) if (enableLog)
{ {

View File

@ -64,6 +64,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress) public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
{ {
OnProgress(0);
var innerProgress = new ActionableProgress<double>(); var innerProgress = new ActionableProgress<double>();
innerProgress.RegisterAction(p => innerProgress.RegisterAction(p =>
{ {
@ -146,6 +148,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
if (itemId != Guid.Empty) if (itemId != Guid.Empty)
{ {
LogMessage(string.Format("Querying item {0}", itemId));
// Somehow some invalid data got into the db. It probably predates the boundary checking // Somehow some invalid data got into the db. It probably predates the boundary checking
var item = _libraryManager.GetItemById(itemId); var item = _libraryManager.GetItemById(itemId);
@ -153,6 +157,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
{ {
try try
{ {
LogMessage(string.Format("Saving item {0}", itemId));
await _itemRepo.SaveItem(item, cancellationToken).ConfigureAwait(false); await _itemRepo.SaveItem(item, cancellationToken).ConfigureAwait(false);
} }
catch (OperationCanceledException) catch (OperationCanceledException)
@ -175,6 +181,14 @@ namespace MediaBrowser.Server.Implementations.Persistence
progress.Report(100); progress.Report(100);
} }
private void LogMessage(string msg)
{
if (EnableUnavailableMessage)
{
_logger.Info(msg);
}
}
private async Task CleanDeadItems(CancellationToken cancellationToken, IProgress<double> progress) private async Task CleanDeadItems(CancellationToken cancellationToken, IProgress<double> progress)
{ {
var itemIds = _libraryManager.GetItemIds(new InternalItemsQuery var itemIds = _libraryManager.GetItemIds(new InternalItemsQuery