Skip to content

Commit

Permalink
fix: Debouncing job can fail on multiple results returned by key
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCizmar committed Jan 25, 2024
1 parent d5c4d1b commit 9779663
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ interface BatchJobRepository : JpaRepository<BatchJob, Long> {
from BatchJob j
where j.debouncingKey = :debouncingKey
and j.status = 'PENDING'
and j.id = (select max(j2.id) from BatchJob j2 where j2.debouncingKey = :debouncingKey and j2.status = 'PENDING')
""",
)
fun findBatchJobByDebouncingKey(debouncingKey: String?): BatchJob?
fun findBatchJobByDebouncingKey(debouncingKey: String): BatchJob?
}

0 comments on commit 9779663

Please sign in to comment.