Skip to content

Commit

Permalink
Deaktiverer ArbeidssokerperiodeScheduler midlertidig
Browse files Browse the repository at this point in the history
  • Loading branch information
maccyber committed Nov 7, 2023
1 parent 57197c4 commit 4ae3325
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ArbeidssokerperiodeScheduler(
private val arbeidssokerperiodeService: ArbeidssokerperiodeService,
private val arbeidssokerperiodeProducer: ArbeidssokerperiodeProducer,
) {
// @Scheduled(cron = "* * * * * *")
@Scheduled(cron = "HVERT_TIENDE_SEKUND")
fun start() {
if (!leaderElectionClient.isLeader) {
return
Expand All @@ -28,6 +28,10 @@ class ArbeidssokerperiodeScheduler(

arbeidssokerperiodeProducer.publiserArbeidssokerperioder(arbeidssokerperioder)

// arbeidssokerperiodeService.settArbeidssokerperioderSomOverfort(arbeidssokerperioder.map { it.id })
arbeidssokerperiodeService.settArbeidssokerperioderSomOverfort(arbeidssokerperioder.map { it.id })
}

companion object {
const val HVERT_TIENDE_SEKUND = "0/10 * * * * *"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ArbeidssokerperiodeRepositoryImpl(private val db: NamedParameterJdbcTempla
}

override fun hentNesteArbeidssokerperioder(): List<ArbeidssokerperiodeDto> {
val sql = "SELECT * FROM $ARBEIDSSOKERPERIODE_TABELL WHERE overfort_kafka IS FALSE ORDER BY fra_og_med LIMIT 1"
val sql = "SELECT * FROM $ARBEIDSSOKERPERIODE_TABELL WHERE overfort_kafka IS FALSE ORDER BY fra_og_med LIMIT 50"
return db.query(sql, arbeidssokerperiodeMapper)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import org.springframework.scheduling.annotation.Scheduled
class PubliseringAvRegistreringEventsScheduler(
private val publiseringAvEventsService: PubliseringAvEventsService,
private val leaderElectionClient: LeaderElectionClient,
private val unleashClient: UnleashClient
private val unleashClient: UnleashClient,
) {
@Scheduled(cron = HVERT_TIENDE_SEKUND)
// @Scheduled(cron = HVERT_TIENDE_SEKUND)
fun publiserRegistreringEvents() {
try {
CallId.leggTilCallId()
Expand All @@ -34,4 +34,4 @@ class PubliseringAvRegistreringEventsScheduler(
private val LOG = LoggerFactory.getLogger(PubliseringAvRegistreringEventsScheduler::class.java)
const val HVERT_TIENDE_SEKUND = "0/10 * * * * *"
}
}
}

0 comments on commit 4ae3325

Please sign in to comment.