Skip to content

Commit

Permalink
Merge pull request #34 from pagopa/fix-length-version
Browse files Browse the repository at this point in the history
fix length version
  • Loading branch information
jacopocarlini committed Aug 31, 2023
2 parents 11723a3 + b242ca2 commit 01acd63
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_with_github_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
cluster_name: ${{ vars.CLUSTER_NAME }}
resource_group: ${{ vars.CLUSTER_RESOURCE_GROUP }}
app_name: ${{ env.APP_NAME }}
helm_upgrade_options: "--debug --set postgresql.enabled=true --set oracle.enabled=true --set oracledev.enabled=true --set oracleprod.enabled=true"
helm_upgrade_options: ${{ inputs.environment == 'dev' && "--debug --set postgresql.enabled=true --set oracle.enabled=true --set oracledev.enabled=true --set oracleprod.enabled=true" || "--debug --set postgresql.enabled=true --set oracle.enabled=true" }}

cleanup_runner:
name: Cleanup Runner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public ConfigDataV1 newCacheV1(String stakeholder, Optional<NodeCacheKey[]> 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) {
Expand All @@ -479,6 +479,14 @@ public ConfigDataV1 newCacheV1(String stakeholder, Optional<NodeCacheKey[]> 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);
Expand Down

0 comments on commit 01acd63

Please sign in to comment.