mirror of
https://github.com/lidarr/Lidarr
synced 2025-01-30 19:02:06 +00:00
More logging for CommandExecutor
This commit is contained in:
parent
49718fbfbe
commit
aae3970865
3 changed files with 7 additions and 5 deletions
|
@ -48,12 +48,12 @@ private void ExecuteCommands()
|
|||
}
|
||||
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 @@ private void ExecuteCommand<TCommand>(TCommand command, CommandModel commandMode
|
|||
}
|
||||
catch (CommandFailedException ex)
|
||||
{
|
||||
_commandQueueManager.SetMessage(commandModel, "Failed");
|
||||
_commandQueueManager.Fail(commandModel, ex.Message, ex);
|
||||
throw;
|
||||
}
|
||||
|
|
|
@ -150,14 +150,15 @@ public void Requeue()
|
|||
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 @@ public void Start(CommandModel command)
|
|||
|
||||
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…
Reference in a new issue