-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Lager en egen cron expression som er forskjellig fra dev og prod * Fjerner leader-pod sjekk * Trenger ikke async-flagg da dette trigges fra scheduler og ikke rest-kall
- Loading branch information
1 parent
b66ef63
commit 922be38
Showing
4 changed files
with
12 additions
and
7 deletions.
There are no files selected for viewing
12 changes: 7 additions & 5 deletions
12
src/main/kotlin/no/nav/familie/ef/personhendelse/inntekt/InntektsendringerScheduler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
package no.nav.familie.ef.personhendelse.inntekt | ||
|
||
import no.nav.familie.leader.LeaderClient | ||
import org.slf4j.Logger | ||
import org.slf4j.LoggerFactory | ||
import org.springframework.scheduling.annotation.Scheduled | ||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
class InntektsendringerScheduler(val vedtakendringerService: VedtakendringerService) { | ||
|
||
@Scheduled(cron = "0 0 4 6 * *") // kl 04:00 den 6. hver måned | ||
val logger: Logger = LoggerFactory.getLogger(this::class.java) | ||
@Scheduled(cron = "\${INNTEKTSKONTROLL_CRON_EXPRESSION}") // kl 04:00 den 6. hver måned | ||
fun inntektskontroll() { | ||
if (LeaderClient.isLeader() == true) { | ||
vedtakendringerService.beregnInntektsendringerOgLagreIDb() | ||
vedtakendringerService.opprettOppgaverForInntektsendringer(true) | ||
} | ||
logger.info("Cron scheduler starter inntektskontroll") | ||
vedtakendringerService.beregnInntektsendringerOgLagreIDb() | ||
vedtakendringerService.opprettOppgaverForInntektsendringer(true) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
DEPLOY_ENV: dev | ||
|
||
INNTEKTSKONTROLL_CRON_EXPRESSION: 0 0 10 3 * * # kl 10:00 den 3. hver måned |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters