Change events args
This commit is contained in:
@ -5,12 +5,14 @@ namespace Hcs.WebApp.BackgroundServices
|
||||
{
|
||||
public class ResultWaitState
|
||||
{
|
||||
public delegate void OperationEnded(int operationId, int campaignId, DateTime endedAt, string failureReason);
|
||||
|
||||
private readonly ConcurrentQueue<Operation> operationsInQueue = new();
|
||||
private readonly HashSet<Operation> operationsInProcess = [];
|
||||
|
||||
public bool Ready { get; set; }
|
||||
|
||||
public event Action<Operation> OnOperationEnded;
|
||||
public event OperationEnded OnOperationEnded;
|
||||
|
||||
public void EnqueueOperation(Operation operation)
|
||||
{
|
||||
@ -37,11 +39,11 @@ namespace Hcs.WebApp.BackgroundServices
|
||||
return operationsInQueue.Any(x => x.CampaignId == campaignId) || operationsInProcess.Any(x => x.CampaignId == campaignId);
|
||||
}
|
||||
|
||||
public void InvokeOnOperationEnded(Operation operation)
|
||||
public void InvokeOnOperationEnded(int operationId, int campaignId, DateTime endedAt, string failureReason)
|
||||
{
|
||||
try
|
||||
{
|
||||
OnOperationEnded?.Invoke(operation);
|
||||
OnOperationEnded?.Invoke(operationId, campaignId, endedAt, failureReason);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user