Skip to content

Commit

Permalink
🔊 Logger dersom snapshot ikke inneholder forventet fnr
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindhagen committed Nov 22, 2024
1 parent 33ebb1c commit c72b54b
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ import no.nav.helse.spesialist.api.graphql.schema.Personinfo
import no.nav.helse.spesialist.api.objectMapper
import no.nav.helse.spleis.graphql.hentsnapshot.GraphQLPerson
import org.intellij.lang.annotations.Language
import org.slf4j.LoggerFactory
import javax.sql.DataSource

class SnapshotApiDao(private val dataSource: DataSource) {
private companion object {
private val sikkerLogg = LoggerFactory.getLogger("tjenestekall")
}

fun hentSnapshotMedMetadata(fødselsnummer: String): Pair<Personinfo, GraphQLPerson>? =
sessionOf(dataSource).use { session ->
@Language("PostgreSQL")
Expand Down Expand Up @@ -56,7 +61,11 @@ class SnapshotApiDao(private val dataSource: DataSource) {
if (versjon > tx.finnGlobalVersjon()) {
tx.oppdaterGlobalVersjon(versjon)
}
tx.lagre(personRef, objectMapper.writeValueAsString(snapshot), versjon)
val snapshotJson = objectMapper.writeValueAsString(snapshot)
if (!snapshotJson.contains(fødselsnummer)) {
sikkerLogg.warn("Henter snapshot for fnr $fødselsnummer, mottar snapshot: $snapshotJson")
}
tx.lagre(personRef, snapshotJson, versjon)
}
}
}
Expand Down

0 comments on commit c72b54b

Please sign in to comment.