More logging for CommandExecutor

pull/4/head
Mark McDowall 10 years ago
parent 49718fbfbe
commit aae3970865

@ -48,12 +48,12 @@ namespace NzbDrone.Core.Messaging.Commands
}
catch (ThreadAbortException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.ErrorException("Thread aborted: " + ex.Message, ex);
Thread.ResetAbort();
}
catch (Exception ex)
{
_logger.Error(ex.Message, ex);
_logger.Error("Unknown error in thread: " + ex.Message, ex);
}
}
@ -80,6 +80,7 @@ namespace NzbDrone.Core.Messaging.Commands
}
catch (CommandFailedException ex)
{
_commandQueueManager.SetMessage(commandModel, "Failed");
_commandQueueManager.Fail(commandModel, ex.Message, ex);
throw;
}

@ -150,14 +150,15 @@ namespace NzbDrone.Core.Messaging.Commands
public void CleanCommands()
{
_logger.Trace("Cleaning up old commands");
_repo.Trim();
var old = _commandCache.Values.Where(c => c.EndedAt < DateTime.UtcNow.AddMinutes(5));
foreach (var command in old)
{
_commandCache.Remove(command.Id.ToString());
}
_repo.Trim();
}
private dynamic GetCommand(string commandName)

@ -77,7 +77,7 @@ namespace NzbDrone.Core.Messaging.Commands
public void End(CommandModel command)
{
SetFields(command, c => c.EndedAt, c => c.Status, c => c.Duration);
SetFields(command, c => c.EndedAt, c => c.Status, c => c.Duration, c => c.Exception);
}
}
}

Loading…
Cancel
Save