Skip to content

Commit d6945e3

Browse files
committed
Fixed flaky deadlock in tests
1 parent 7321e30 commit d6945e3

4 files changed

Lines changed: 10 additions & 0 deletions

File tree

app/src/main/kotlin/io/klibs/app/job/PackageVersionTypeJob.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import org.springframework.stereotype.Component
1010
import java.util.concurrent.TimeUnit
1111

1212
@Component
13+
@ConditionalOnProperty(
14+
value = ["klibs.scheduling.fill-version-type.enabled"],
15+
havingValue = "true",
16+
)
1317
class PackageVersionTypeJob(private val packageService: PackageService) {
1418

1519
private val logger = LoggerFactory.getLogger(PackageVersionTypeJob::class.java)

app/src/main/kotlin/io/klibs/app/job/RefreshDependentCountJob.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import io.micrometer.core.annotation.Timed
55
import net.javacrumbs.shedlock.core.LockAssert
66
import net.javacrumbs.shedlock.spring.annotation.SchedulerLock
77
import org.slf4j.LoggerFactory
8+
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
89
import org.springframework.scheduling.annotation.Scheduled
910
import org.springframework.stereotype.Component
1011
import java.util.concurrent.TimeUnit
1112

1213
@Component
14+
@ConditionalOnProperty("klibs.indexing", havingValue = "true")
1315
class RefreshDependentCountJob(
1416
private val projectRepository: ProjectRepository,
1517
) {

app/src/main/resources/application.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ klibs:
7878
scheduling:
7979
process-indexing-queue:
8080
enabled: ${PROCESS_INDEXING_QUEUE_ENABLED:true}
81+
fill-version-type:
82+
enabled: ${FILL_VERSION_TYPE_ENABLED:true}
8183
indexing-configuration:
8284
executor:
8385
thread-count: 2

app/src/test/resources/application-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ klibs:
44
scheduling:
55
process-indexing-queue:
66
enabled: false
7+
fill-version-type:
8+
enabled: false
79

810
spring:
911
sql:

0 commit comments

Comments
 (0)