-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hent ut om det er quiz eller behandling som skal automatisere
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
mediator/src/main/kotlin/no/nav/dagpenger/mottak/Unleash.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package no.nav.dagpenger.mottak | ||
|
||
import com.natpryce.konfig.Key | ||
import com.natpryce.konfig.stringType | ||
import io.getunleash.DefaultUnleash | ||
import io.getunleash.Unleash | ||
import io.getunleash.util.UnleashConfig | ||
import no.nav.dagpenger.mottak.Config.properties | ||
import java.net.InetAddress | ||
|
||
val unleash: Unleash by lazy { | ||
DefaultUnleash( | ||
UnleashConfig.builder() | ||
.appName(properties[Key("NAIS_APP_NAME", stringType)]) | ||
.instanceId(runCatching { InetAddress.getLocalHost().hostName }.getOrElse { "ukjent" }) | ||
.unleashAPI(properties[Key("UNLEASH_SERVER_API_URL", stringType)] + "/api/") | ||
.apiKey(properties[Key("UNLEASH_SERVER_API_TOKEN", stringType)]) | ||
.environment( | ||
when (System.getenv("NAIS_CLUSTER_NAME").orEmpty()) { | ||
"prod-gcp" -> "production" | ||
else -> "development" | ||
}, | ||
).build(), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters