mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-25 22:59:10 -04:00
Prevent ProgressMessageTarget from ever reading the command from the database.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user