Skip to content

Commit

Permalink
F - Legger til retry for getSedJson
Browse files Browse the repository at this point in the history
  • Loading branch information
dskarpas committed Oct 15, 2024
1 parent 0ce9a0a commit 7ff6780
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ open class EuxKlientLib(private val euxRestTemplate: RestTemplate, override var

private val logger: Logger by lazy { LoggerFactory.getLogger(EuxKlientLib::class.java) }

fun hentSedJson(rinaSakId: String, dokumentId: String): String? {
fun hentSedJson(rinaSakId: String, dokumentId: String, skipError: List<HttpStatus>? = emptyList()): String? {
logger.info("Henter SED for rinaSakId: $rinaSakId , dokumentId: $dokumentId")

return euxRestTemplate.getForObject(
"/buc/$rinaSakId/sed/$dokumentId", String::class.java
return retryHelper(
func = { euxRestTemplate.getForObject("/buc/$rinaSakId/sed/$dokumentId", String::class.java) },
maxAttempts = 3,
skipError = skipError
)
}

Expand Down

0 comments on commit 7ff6780

Please sign in to comment.