Updating
This commit is contained in:
+1
-1
@@ -72,7 +72,7 @@ namespace LCU.Api.Internal.Dispatcher.Services.DispatcherOperationServices
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await _queueSendErroredJobAlertService.QueueSendErroredJobAlert(job, workItem);
|
await _queueSendErroredJobAlertService.QueueSendErroredJobAlert(updatedJob, workItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (ServiceException serviceException)
|
catch (ServiceException serviceException)
|
||||||
|
|||||||
+2
-1
@@ -145,6 +145,7 @@ public class JobRepository : BaseRepository, IJobRepository
|
|||||||
public async Task<Job> Update(Job job)
|
public async Task<Job> Update(Job job)
|
||||||
{
|
{
|
||||||
var trackedJob = await _context.Jobs
|
var trackedJob = await _context.Jobs
|
||||||
|
.IncludeErrorRecipients()
|
||||||
.FirstAsync(j => j.JobId == job.JobId);
|
.FirstAsync(j => j.JobId == job.JobId);
|
||||||
|
|
||||||
_context.Entry(trackedJob).CurrentValues.SetValues(job);
|
_context.Entry(trackedJob).CurrentValues.SetValues(job);
|
||||||
@@ -156,4 +157,4 @@ public class JobRepository : BaseRepository, IJobRepository
|
|||||||
{
|
{
|
||||||
_context.Jobs.Remove(job);
|
_context.Jobs.Remove(job);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-3
@@ -35,7 +35,7 @@ public class JobFailureServiceTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task HandleJobFailureRequest_QueuesErroredJobAlert_WithOriginalJobErrorRecipients()
|
public async Task HandleJobFailureRequest_QueuesErroredJobAlert_WithUpdatedJobErrorRecipients()
|
||||||
{
|
{
|
||||||
var workItemExecution = new WorkItemExecution
|
var workItemExecution = new WorkItemExecution
|
||||||
{
|
{
|
||||||
@@ -64,7 +64,10 @@ public class JobFailureServiceTest
|
|||||||
{
|
{
|
||||||
JobId = 22,
|
JobId = 22,
|
||||||
JobStatus = JobStatus.Failed,
|
JobStatus = JobStatus.Failed,
|
||||||
JobErrorRecipients = new List<JobErrorRecipient>()
|
JobErrorRecipients = new List<JobErrorRecipient>
|
||||||
|
{
|
||||||
|
new JobErrorRecipient { Recipient = "[email protected]" }
|
||||||
|
}
|
||||||
};
|
};
|
||||||
var request = new JobFailureRequest
|
var request = new JobFailureRequest
|
||||||
{
|
{
|
||||||
@@ -82,7 +85,7 @@ public class JobFailureServiceTest
|
|||||||
|
|
||||||
_mockQueueSendErroredJobAlertService.Verify(x => x.QueueSendErroredJobAlert(
|
_mockQueueSendErroredJobAlertService.Verify(x => x.QueueSendErroredJobAlert(
|
||||||
It.Is<Job>(queuedJob =>
|
It.Is<Job>(queuedJob =>
|
||||||
queuedJob.JobId == job.JobId &&
|
queuedJob.JobId == updatedJob.JobId &&
|
||||||
queuedJob.JobStatus == JobStatus.Failed &&
|
queuedJob.JobStatus == JobStatus.Failed &&
|
||||||
queuedJob.JobErrorRecipients.Count == 1 &&
|
queuedJob.JobErrorRecipients.Count == 1 &&
|
||||||
queuedJob.JobErrorRecipients.First().Recipient == "[email protected]"),
|
queuedJob.JobErrorRecipients.First().Recipient == "[email protected]"),
|
||||||
|
|||||||
Reference in New Issue
Block a user