diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 81cfbc78..66b14a4d 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: pagopa-api-cache-chart description: Microservice that handles calculation for pagoPA Advanced Fees Management type: application -version: 0.5.0 +version: 0.6.0 dependencies: - name: microservice-chart version: 3.0.0 @@ -24,4 +24,4 @@ dependencies: repository: "https://pagopa.github.io/aks-microservice-chart-blueprint" alias: oracleprod condition: oracleprod.enabled -appVersion: 0.6.4 +appVersion: 0.7.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 1a045ee1..c9a9cd6f 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -2,12 +2,12 @@ microservice-chart: µservice-chart namespace: "apiconfig" image: repository: ghcr.io/pagopa/pagopa-api-config-cache - tag: 0.6.4 + tag: 0.7.0 canaryDelivery: deployment: image: repository: ghcr.io/pagopa/pagopa-api-config-cache - tag: 0.6.4 + tag: 0.7.0 livenessProbe: httpGet: path: /actuator/health/liveness diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index c07e7858..5301fd7b 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -2,12 +2,12 @@ microservice-chart: µservice-chart namespace: "apiconfig" image: repository: ghcr.io/pagopa/pagopa-api-config-cache - tag: 0.6.4 + tag: 0.7.0 canaryDelivery: deployment: image: repository: ghcr.io/pagopa/pagopa-api-config-cache - tag: 0.6.4 + tag: 0.7.0 livenessProbe: httpGet: path: /actuator/health/liveness diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 1090f605..96759433 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -2,12 +2,12 @@ microservice-chart: µservice-chart namespace: "apiconfig" image: repository: ghcr.io/pagopa/pagopa-api-config-cache - tag: 0.6.4 + tag: 0.7.0 canaryDelivery: deployment: image: repository: ghcr.io/pagopa/pagopa-api-config-cache - tag: 0.6.4 + tag: 0.7.0 livenessProbe: httpGet: path: /actuator/health/liveness diff --git a/openapi/openapi.json b/openapi/openapi.json index b4a9c629..562afb85 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "API-Config Cacher", "description": "Generate cache for regarding Nodo dei Pagamenti configuration", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.6.4" + "version": "0.7.0" }, "servers": [ { diff --git a/openapi/openapi_fdrv1.json b/openapi/openapi_fdrv1.json index 248e2bfa..59c78ff5 100644 --- a/openapi/openapi_fdrv1.json +++ b/openapi/openapi_fdrv1.json @@ -4,7 +4,7 @@ "title": "API-Config Cacher", "description": "Generate cache for regarding Nodo dei Pagamenti configuration", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.6.4" + "version": "0.7.0" }, "servers": [ { diff --git a/openapi/openapi_nodev1.json b/openapi/openapi_nodev1.json index a16c1370..0b147960 100644 --- a/openapi/openapi_nodev1.json +++ b/openapi/openapi_nodev1.json @@ -4,7 +4,7 @@ "title": "API-Config Cacher", "description": "Generate cache for regarding Nodo dei Pagamenti configuration", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.6.4" + "version": "0.7.0" }, "servers": [ { diff --git a/openapi/openapi_verifierv1.json b/openapi/openapi_verifierv1.json index e86f1b5b..2c0efddb 100644 --- a/openapi/openapi_verifierv1.json +++ b/openapi/openapi_verifierv1.json @@ -4,7 +4,7 @@ "title": "API-Config Cacher", "description": "Generate cache for regarding Nodo dei Pagamenti configuration", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.6.4" + "version": "0.7.0" }, "servers": [ { diff --git a/pom.xml b/pom.xml index 5c307223..fa1c2f9a 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ it.gov.pagopa.api-config cache - 0.6.4 + 0.7.0 API-Config Cacher Generate cache for regarding Nodo dei Pagamenti configuration diff --git a/src/main/java/it/gov/pagopa/apiconfig/cache/service/ConfigService.java b/src/main/java/it/gov/pagopa/apiconfig/cache/service/ConfigService.java index c8094358..b7b8a6c2 100644 --- a/src/main/java/it/gov/pagopa/apiconfig/cache/service/ConfigService.java +++ b/src/main/java/it/gov/pagopa/apiconfig/cache/service/ConfigService.java @@ -463,7 +463,7 @@ public ConfigDataV1 newCacheV1(String stakeholder, Optional keys .id(configData.getVersion()) .cache(jsonSerializer.serialize(configData)) .time(ZonedDateTime.now()) - .version((Constants.GZIP_JSON_V1 + "-" + appVersion).substring(0, 32)) + .version(getVersion()) .build()); log.info("saved on CACHE table " + configData.getVersion()); } catch (Exception e) { @@ -479,6 +479,14 @@ public ConfigDataV1 newCacheV1(String stakeholder, Optional keys return configData; } + private String getVersion() { + String version = Constants.GZIP_JSON_V1 + "-" + appVersion; + if (version.length() > 32) { + return version.substring(0, 32); + } + return version; + } + public void removeCacheV1InProgress(String stakeholder) { String actualKeyV1 = getKeyV1InProgress(stakeholder); redisRepository.remove(actualKeyV1);