Skip to content

Commit a2babf6

Browse files
committed
Utrekk starter ikke :-|
1 parent e2c5455 commit a2babf6

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

dp-inntekt-api/src/main/kotlin/no/nav/dagpenger/inntekt/Application.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,18 @@ fun main() {
129129
)
130130
}
131131

132-
val uttrekksjobb = Uttrekksjobb(dataSource, inntektskomponentHttpClient)
133-
launch {
134-
delay(10000L)
135-
uttrekksjobb.hentInntekterOgSjekk()
132+
Uttrekksjobb(dataSource, inntektskomponentHttpClient).also {
133+
fixedRateTimer(
134+
name = "uttrekk",
135+
initialDelay = TimeUnit.MINUTES.toMillis(1),
136+
period = TimeUnit.HOURS.toMillis(1),
137+
action = {
138+
LOGGER.info { "UTTREKK" }
139+
runBlocking { it.hentInntekterOgSjekk() }
140+
LOGGER.info { "UTTREKK" }
141+
}
142+
)
136143
}
144+
137145
}
138146
}

0 commit comments

Comments
 (0)