Prevent ProgressMessageTarget from ever reading the command from the database.

This commit is contained in:
Taloth Saldono
2015-06-03 20:17:50 +02:00
parent 6d18b37a94
commit 866f971d41
6 changed files with 52 additions and 39 deletions
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NzbDrone.Core.Messaging.Commands;
namespace NzbDrone.Core.ProgressMessaging
{
public static class ProgressMessageContext
{
[ThreadStatic]
private static CommandModel _commandModel;
[ThreadStatic]
private static bool _reentrancyLock;
public static CommandModel CommandModel
{
get { return _commandModel; }
set { _commandModel = value; }
}
public static bool LockReentrancy()
{
if (_reentrancyLock)
return false;
_reentrancyLock = true;
return true;
}
public static void UnlockReentrancy()
{
_reentrancyLock = false;
}
}
}