Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
AudunSorheim committed Dec 15, 2023
1 parent 668db58 commit 4ca8bd4
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 56 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/deploy-redis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy Redis

on:
push:
paths: ['nais/redis-dev.yaml', 'nais/redis-prod.yaml']
workflow_dispatch:

jobs:
deploy-redis-dev-gcp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: nais/redis-dev-gcp.yaml

deploy-redis-prod-gcp:
if: github.ref == 'refs/heads/main'
needs: deploy-redis-dev-gcp
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: nais/redis-prod-gcp.yaml
11 changes: 11 additions & 0 deletions nais/redis-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: aiven.io/v1alpha1
kind: Redis
metadata:
labels:
app: oppfolgingsplan-backend-redis
team: team-esyfo
name: redis-team-esyfo-oppfolgingsplan-backend
namespace: team-esyfo
spec:
plan: startup-4
project: nav-dev
11 changes: 11 additions & 0 deletions nais/redis-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: aiven.io/v1alpha1
kind: Redis
metadata:
labels:
app: oppfolgingsplan-backend-redis
team: team-esyfo
name: redis-team-esyfo-oppfolgingsplan-backend
namespace: team-esyfo
spec:
plan: startup-4
project: nav-prod
54 changes: 0 additions & 54 deletions src/main/kotlin/no/nav/syfo/config/CacheConfig.kt

This file was deleted.

3 changes: 1 addition & 2 deletions src/main/kotlin/no/nav/syfo/kontaktinfo/KrrClient.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package no.nav.syfo.kontaktinfo

import no.nav.syfo.auth.azure.AzureAdTokenClient
import no.nav.syfo.config.CacheConfig
import no.nav.syfo.metric.Metrikk
import no.nav.syfo.util.NAV_CALL_ID_HEADER
import no.nav.syfo.util.NAV_PERSONIDENT_HEADER
Expand All @@ -26,7 +25,7 @@ class KrrClient @Autowired constructor(
@Value("\${krr.scope}") private val krrScope: String,
@Value("\${krr.url}") val krrUrl: String,
) {
@Cacheable(cacheNames = [CacheConfig.CACHENAME_DKIF_FNR], key = "#fnr", condition = "#fnr != null")
@Cacheable(cacheNames = ["krr_fnr"], key = "#fnr", condition = "#fnr != null")
fun kontaktinformasjon(fnr: String): DigitalKontaktinfo {
val accessToken = "Bearer ${azureAdTokenConsumer.getSystemToken(krrScope)}"
val response = RestTemplate().exchange(
Expand Down
16 changes: 16 additions & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ spring:
hikari:
minimum-idle: 1
maximum-pool-size: 5
data:
redis:
url: ${REDIS_URI_OPPFOLGINGSPLAN:}
username: ${REDIS_USERNAME_OPPFOLGINGSPLAN:}
password: ${REDIS_PASSWORD_OPPFOLGINGSPLAN:}
timeout: 2000
lettuce:
pool:
max-active: 16
min-idle: 8
enabled: true
time-between-eviction-runs: 10000
cache:
redis:
time-to-live: 3600
enable-statistics: true

management:
endpoint:
Expand Down

0 comments on commit 4ca8bd4

Please sign in to comment.