Skip to content

Commit

Permalink
Hendelseprosessor: Begrenser antall states som gjennomgåes for sletti…
Browse files Browse the repository at this point in the history
…ng til 10k for å hindre timeout errors, senker intervallet for sletting til 2 timer
  • Loading branch information
robertkittilsen committed Dec 23, 2024
1 parent 0bd5081 commit b54e65c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TilstandsLaster(
tilstandsopprydding(
requireNotNull(context) { "Context er ikke initialisert" },
requireNotNull(tilstandsDb){ "TilstandsDb er ikke initialisert" },
Duration.ofDays(1),
Duration.ofHours(2),
keepGoing
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ fun tilstandsopprydding(
stateStore.all().use { tilstander ->
tilstander.asSequence().takeWhile { keepGoing.get() }
.filter { it.value.skalSlettes() }
.take(10000)
.onEach { tilstand ->
try {
stateStore.delete(tilstand.key)
Expand Down

0 comments on commit b54e65c

Please sign in to comment.