Skip to content

Commit

Permalink
caching issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Priyanka Jain committed Feb 10, 2025
1 parent bb500c0 commit 8e194f0
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public final class CommonConstant {
public static final String CACHE_BOARD_META_DATA_MAP = "boardMetaDataMap";
public static final String CACHE_PROJECT_CONFIG_MAP = "projectConfigMap";
public static final String CACHE_PROJECT_TOOL_CONFIG_MAP = "projectToolConfigMap";
public static final String CACHE_PROJECT_KPI_DATA = "project_kpi_data_cache";

public static final String PARAM1 = "param1";
public static final String PARAM2 = "param2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.requestMatchers("/forgotPassword").permitAll()
.requestMatchers("/validateEmailToken**").permitAll()
.requestMatchers("/resetPassword").permitAll()
.requestMatchers("/cache/clearAllCache").permitAll().requestMatchers(HttpMethod.GET, "/cache/clearCache/**")
.permitAll().requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
.requestMatchers("/cache/**").permitAll()
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
.requestMatchers(HttpMethod.GET, "/analytics/switch").permitAll().anyRequest().authenticated())
.addFilterBefore(standardLoginRequestFilter(authenticationManager), UsernamePasswordAuthenticationFilter.class)
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ public boolean execute(ArgoCDProcessor processor) {
}
}
if (count1.get() > 0) {
cacheRestClient(CommonConstant.CACHE_CLEAR_PROJECT_SOURCE_ENDPOINT, CommonConstant.JENKINS,
proBasicConfig.getId().toString());
cacheRestClient(CommonConstant.CACHE_CLEAR_PROJECT_SOURCE_ENDPOINT, proBasicConfig.getId().toString(),
CommonConstant.JENKINS);
}
}
MDC.put(TOTAL_UPDATED_COUNT, String.valueOf(count.get()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ private boolean fetchIssueDetail(boolean executionStatus, List<ProjectBasicConfi
azureRestClientFactory.cacheRestClient(CommonConstant.CACHE_CLEAR_ENDPOINT,
CommonConstant.CACHE_PROJECT_TOOL_CONFIG);
azureRestClientFactory.cacheRestClient(CommonConstant.CACHE_CLEAR_ENDPOINT, CommonConstant.JIRA_KPI_CACHE);
azureRestClientFactory.cacheRestClient(CommonConstant.CACHE_CLEAR_SOURCE_ENDPOINT, CommonConstant.JIRA_KPI,
"");
azureRestClientFactory.cacheRestClient(CommonConstant.CACHE_CLEAR_ENDPOINT, CommonConstant.CACHE_PROJECT_KPI_DATA);
}
if (kanbanIssueCount.get() > 0) {
azureRestClientFactory.cacheRestClient(CommonConstant.CACHE_CLEAR_ENDPOINT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ public boolean execute(AzurePipelineProcessor processor) {
count1 = buildJobs(processor, startTime, count1, azurePipelineServer, lastStartTimeOfJobs,
proBasicConfig);
} else {
count1 += deployJobs(processor, startTime, deploymentJobs, activeDeployJobs, azurePipelineServer,
lastStartTimeOfJobs, proBasicConfig);
count1 += deployJobs(processor, startTime, deploymentJobs, activeDeployJobs,
azurePipelineServer, lastStartTimeOfJobs, proBasicConfig);
}
count += count1;
log.info("Finished : {}", startTime);
Expand All @@ -220,8 +220,8 @@ public boolean execute(AzurePipelineProcessor processor) {
}
}
if (count1 > 0) {
cacheRestClient(CommonConstant.CACHE_CLEAR_PROJECT_SOURCE_ENDPOINT, CommonConstant.JENKINS,
proBasicConfig.getId().toString());
cacheRestClient(CommonConstant.CACHE_CLEAR_PROJECT_SOURCE_ENDPOINT, proBasicConfig.getId().toString(),
CommonConstant.JENKINS);
}
}
MDC.put(TOTAL_UPDATED_COUNT, String.valueOf(count));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ private void processEachBambooJobOnJobType(List<ProcessorToolConnection> bambooJ
}
}
if (count > 0 || !activeDeployJobs.isEmpty()) {
cacheRestClient(CommonConstant.CACHE_CLEAR_PROJECT_SOURCE_ENDPOINT, CommonConstant.JENKINS,
proBasicConfig.getId().toString());
cacheRestClient(CommonConstant.CACHE_CLEAR_PROJECT_SOURCE_ENDPOINT, proBasicConfig.getId().toString(),
CommonConstant.JENKINS);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ public boolean execute(GitHubActionProcessor processor) {
}
}
if (count1 > 0) {
cacheRestClient(CommonConstant.CACHE_CLEAR_PROJECT_SOURCE_ENDPOINT, CommonConstant.JENKINS,
proBasicConfig.getId().toString());
cacheRestClient(CommonConstant.CACHE_CLEAR_PROJECT_SOURCE_ENDPOINT, proBasicConfig.getId().toString(),
CommonConstant.JENKINS);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ public boolean execute(JenkinsProcessor processor) {
}
}
if (count1 > 0) {
cacheRestClient(CommonConstant.CACHE_CLEAR_PROJECT_SOURCE_ENDPOINT, CommonConstant.JENKINS,
proBasicConfig.getId().toString());
cacheRestClient(CommonConstant.CACHE_CLEAR_PROJECT_SOURCE_ENDPOINT, proBasicConfig.getId().toString(),
CommonConstant.JENKINS);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ private void clearCache() {
jiraProcessorCacheEvictor.evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT,
CommonConstant.CACHE_ACCOUNT_HIERARCHY);
jiraProcessorCacheEvictor.evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT, CommonConstant.JIRA_KPI_CACHE);
jiraProcessorCacheEvictor.evictCache(CommonConstant.CACHE_CLEAR_SOURCE_ENDPOINT, CommonConstant.JIRA_KPI, "");
jiraProcessorCacheEvictor.evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT, CommonConstant.CACHE_PROJECT_KPI_DATA);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void afterJob(JobExecution jobExecution) {
processorCacheEvictor.evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT, CommonConstant.JIRA_KPI_CACHE);
processorCacheEvictor.evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT,
CommonConstant.CACHE_PROJECT_TOOL_CONFIG);
processorCacheEvictor.evictCache(CommonConstant.CACHE_CLEAR_SOURCE_ENDPOINT, CommonConstant.JIRA_KPI, "");
processorCacheEvictor.evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT, CommonConstant.CACHE_PROJECT_KPI_DATA);

} else {
sprintTrace.setErrorInFetch(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ public void afterJob(JobExecution jobExecution) {
jiraProcessorCacheEvictor.evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT,
CommonConstant.CACHE_PROJECT_TOOL_CONFIG);
jiraProcessorCacheEvictor.evictCache(CommonConstant.CACHE_CLEAR_ENDPOINT, CommonConstant.JIRA_KPI_CACHE);
jiraProcessorCacheEvictor.evictCache(CommonConstant.CACHE_CLEAR_PROJECT_SOURCE_ENDPOINT,
CommonConstant.JIRA_KPI, projectId);
jiraProcessorCacheEvictor.evictCache(CommonConstant.CACHE_CLEAR_PROJECT_SOURCE_ENDPOINT, projectId,
CommonConstant.JIRA_KPI);
try {
if (jobExecution.getStatus() == BatchStatus.FAILED) {
log.error("job failed : {} for the project : {}", jobExecution.getJobInstance().getJobName(),
Expand Down

0 comments on commit 8e194f0

Please sign in to comment.