Details and queue management

This commit is contained in:
2017-01-06 08:43:22 -05:00
parent d14e40a36b
commit 42ac27e16f
24 changed files with 260 additions and 51 deletions
@@ -83,15 +83,15 @@ namespace LeafWeb.WebCms.Services.PiscalQueue
Logger.InfoFormat("LeafInput: {0}, Starting", pendingInputId);
try
{
DataService.SetLeafInputStatus(pendingInput, LeafInputStatusType.Starting,
details: $"File count: {pendingInput.InputFiles.Count}");
DataService.SetLeafInputStatus(pendingInput, LeafInputStatusType.Starting, "Copying input to Piscal",
$"File count: {pendingInput.InputFiles.Count}");
BackgroundJobEnqueueRetry<StartPending>(c => c.DoWork(pendingInputId));
}
catch (Exception ex)
{
var errorMessage = FormatException(ex);
Logger.Error(errorMessage);
DataService.SetLeafInputStatus(pendingInput, LeafInputStatusType.Exception, ex.Message, errorMessage);
DataService.SetLeafInputStatus(pendingInput, LeafInputStatusType.Exception, "Exception while StartPending", errorMessage);
}
}
@@ -108,8 +108,9 @@ namespace LeafWeb.WebCms.Services.PiscalQueue
{
case PiscalStatus.NotStarted:
// if it's not started - this is unusual state
PiscalWarningHandler($"LeafInput: {leafInput.Id}, Piscal reporting Not Started, setting to pending to retry", leafInput);
DataService.SetLeafInputStatus(leafInput, LeafInputStatusType.Pending);
var pendingToRetry = "Piscal reporting Not Started, setting to Pending to retry";
PiscalWarningHandler($"LeafInput: {leafInput.Id}, {pendingToRetry}", leafInput);
DataService.SetLeafInputStatus(leafInput, LeafInputStatusType.Pending, details: pendingToRetry);
break;
case PiscalStatus.Running:
@@ -118,7 +119,7 @@ namespace LeafWeb.WebCms.Services.PiscalQueue
break;
case PiscalStatus.Complete:
DataService.SetLeafInputStatus(leafInput, LeafInputStatusType.Finishing);
DataService.SetLeafInputStatus(leafInput, LeafInputStatusType.Finishing, "Copying output from Piscal");
BackgroundJobEnqueueRetry<FinishComplete>(s => s.DoWork(leafInputId));
break;