Skip to content

Commit

Permalink
#42 - Remove the on-start trigger - unnecessary now there is an API t…
Browse files Browse the repository at this point in the history
…o trigger runs
  • Loading branch information
chadlwilson committed Oct 25, 2021
1 parent 3377e61 commit 6d18112
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
2 changes: 0 additions & 2 deletions examples/scenario/simple-mysql/application-simple-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ r2dbc:
username: user
password: password
reconciliation:
trigger-on-start:
- test-dataset
datasets:
test-dataset:
source:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package recce.server.config
import io.micronaut.context.BeanLocator
import io.micronaut.context.annotation.ConfigurationInject
import io.micronaut.context.annotation.ConfigurationProperties
import io.micronaut.core.bind.annotation.Bindable
import javax.annotation.PostConstruct
import javax.validation.constraints.NotNull

Expand All @@ -13,10 +12,7 @@ interface PostConstructable {

@ConfigurationProperties("reconciliation")
class ReconciliationConfiguration
@ConfigurationInject constructor(
@Bindable(defaultValue = "") val triggerOnStart: List<String> = emptyList(),
val datasets: Map<String, DatasetConfiguration>
) : PostConstructable {
@ConfigurationInject constructor(val datasets: Map<String, DatasetConfiguration>) : PostConstructable {

@PostConstruct
override fun populate(locator: BeanLocator) {
Expand Down
8 changes: 1 addition & 7 deletions src/main/kotlin/recce/server/dataset/DatasetRecService.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package recce.server.dataset

import io.micronaut.scheduling.annotation.Scheduled
import jakarta.inject.Inject
import jakarta.inject.Singleton
import mu.KotlinLogging
Expand Down Expand Up @@ -71,10 +70,5 @@ open class DatasetRecService(
fun runIgnoreFailure(datasetIds: List<String>): Flux<RecRun> = Flux.fromIterable(datasetIds)
.filter { it.isNotEmpty() }
.flatMap { runFor(it) }
.onErrorContinue { err, it -> logger.warn(err) { "Start-up rec run failed for dataset [$it]." } }

@Scheduled(initialDelay = "0s", fixedDelay = "1d")
open fun scheduledStart() {
runIgnoreFailure(config.triggerOnStart).subscribe()
}
.onErrorContinue { err, it -> logger.warn(err) { "Start-up rec run failed for dataset [$it]." } } // FIXME can hang if all have errors?
}
1 change: 0 additions & 1 deletion src/test/resources/config/application-test-dataset.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
reconciliation:
trigger-on-start: [ ]
datasets:
test-dataset:
source:
Expand Down

0 comments on commit 6d18112

Please sign in to comment.