mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 21:13:28 -07:00
Better names, more info, not using events
This commit is contained in:
parent
bb103947a2
commit
3c632743a1
6 changed files with 107 additions and 74 deletions
29
NzbDrone.Common/Messaging/Tracking/TrackedCommand.cs
Normal file
29
NzbDrone.Common/Messaging/Tracking/TrackedCommand.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
|
||||
namespace NzbDrone.Common.Messaging.Tracking
|
||||
{
|
||||
public class TrackedCommand
|
||||
{
|
||||
public String Type { get; private set; }
|
||||
public ICommand Command { get; private set; }
|
||||
public CommandState State { get; set; }
|
||||
public DateTime StateChangeTime { get; set; }
|
||||
public TimeSpan Runtime { get; set; }
|
||||
public Exception Exception { get; set; }
|
||||
|
||||
public TrackedCommand(ICommand command, CommandState state)
|
||||
{
|
||||
Type = command.GetType().FullName;
|
||||
Command = command;
|
||||
State = state;
|
||||
StateChangeTime = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
|
||||
public enum CommandState
|
||||
{
|
||||
Running = 0,
|
||||
Completed = 1,
|
||||
Failed = 2
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue