Skip to content

Commit

Permalink
Fix: Fjerner runBlocking og gjør metode suspend slik at tokenet er ti…
Browse files Browse the repository at this point in the history
…lgjengelig i coroutine-context
  • Loading branch information
baskevold committed Jan 18, 2024
1 parent 81ac5f8 commit 4e5c6d5
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ class OppgaveKoTjeneste(
return null
}

fun hentSaksbehandlereForKo(oppgaveKoId: Long): List<Saksbehandler> {
suspend fun hentSaksbehandlereForKo(oppgaveKoId: Long): List<Saksbehandler> {
val oppgaveKo = oppgaveKoRepository.hent(oppgaveKoId)
return oppgaveKo.saksbehandlere.map { saksbehandlerEpost: String ->
runBlocking {
saksbehandlerRepository.finnSaksbehandlerMedEpost(saksbehandlerEpost)
}!!
return oppgaveKo.saksbehandlere.mapNotNull { saksbehandlerEpost: String ->
saksbehandlerRepository.finnSaksbehandlerMedEpost(saksbehandlerEpost).also {
if (it == null) { log.info("Køen $oppgaveKoId inneholder saksbehandler som ikke finnes") }
}
}
}
}

0 comments on commit 4e5c6d5

Please sign in to comment.