Skip to content

Commit

Permalink
fix: Select right job status on cancellation (#2329)
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCizmar committed May 30, 2024
1 parent 6cd05f8 commit 506c603
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class BatchJobsCleanerTest : AbstractSpringTest() {
BatchJobStatus.RUNNING,
setOf(
BatchJobChunkExecutionStatus.CANCELLED,
BatchJobChunkExecutionStatus.FAILED,
BatchJobChunkExecutionStatus.SUCCESS,
),
)
Expand All @@ -114,7 +115,6 @@ class BatchJobsCleanerTest : AbstractSpringTest() {
testData.project,
BatchJobStatus.RUNNING,
setOf(
BatchJobChunkExecutionStatus.CANCELLED,
BatchJobChunkExecutionStatus.SUCCESS,
BatchJobChunkExecutionStatus.FAILED,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import org.springframework.stereotype.Component
class BatchJobStatusProvider {
fun getNewStatus(it: Collection<BatchJobChunkExecutionStatus>) =
when {
it.contains(BatchJobChunkExecutionStatus.FAILED) -> BatchJobStatus.FAILED
it.contains(BatchJobChunkExecutionStatus.CANCELLED) -> BatchJobStatus.CANCELLED
it.contains(BatchJobChunkExecutionStatus.FAILED) -> BatchJobStatus.FAILED
else -> BatchJobStatus.SUCCESS
}
}

0 comments on commit 506c603

Please sign in to comment.