This commit is contained in:
Zeeshaun
2026-04-22 16:17:12 +00:00
parent d7bb3fb532
commit 146e9cd8ab
3 changed files with 9 additions and 5 deletions
@@ -72,7 +72,7 @@ namespace LCU.Api.Internal.Dispatcher.Services.DispatcherOperationServices
}
else
{
await _queueSendErroredJobAlertService.QueueSendErroredJobAlert(job, workItem);
await _queueSendErroredJobAlertService.QueueSendErroredJobAlert(updatedJob, workItem);
}
}
catch (ServiceException serviceException)
@@ -145,6 +145,7 @@ public class JobRepository : BaseRepository, IJobRepository
public async Task<Job> Update(Job job)
{
var trackedJob = await _context.Jobs
.IncludeErrorRecipients()
.FirstAsync(j => j.JobId == job.JobId);
_context.Entry(trackedJob).CurrentValues.SetValues(job);
@@ -156,4 +157,4 @@ public class JobRepository : BaseRepository, IJobRepository
{
_context.Jobs.Remove(job);
}
}
}
@@ -35,7 +35,7 @@ public class JobFailureServiceTest
}
[Fact]
public async Task HandleJobFailureRequest_QueuesErroredJobAlert_WithOriginalJobErrorRecipients()
public async Task HandleJobFailureRequest_QueuesErroredJobAlert_WithUpdatedJobErrorRecipients()
{
var workItemExecution = new WorkItemExecution
{
@@ -64,7 +64,10 @@ public class JobFailureServiceTest
{
JobId = 22,
JobStatus = JobStatus.Failed,
JobErrorRecipients = new List<JobErrorRecipient>()
JobErrorRecipients = new List<JobErrorRecipient>
{
new JobErrorRecipient { Recipient = "[email protected]" }
}
};
var request = new JobFailureRequest
{
@@ -82,7 +85,7 @@ public class JobFailureServiceTest
_mockQueueSendErroredJobAlertService.Verify(x => x.QueueSendErroredJobAlert(
It.Is<Job>(queuedJob =>
queuedJob.JobId == job.JobId &&
queuedJob.JobId == updatedJob.JobId &&
queuedJob.JobStatus == JobStatus.Failed &&
queuedJob.JobErrorRecipients.Count == 1 &&
queuedJob.JobErrorRecipients.First().Recipient == "[email protected]"),