Skip to content

Commit

Permalink
Merge pull request #55 from chanmin-00/issue/53-scheduled
Browse files Browse the repository at this point in the history
♻️ [Refactor] Health Check Api 로그 발생 수정
  • Loading branch information
chanmin-00 authored Jul 24, 2024
2 parents 79b1ebf + 2cfde7d commit de44c7b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class SchedulerConfig implements SchedulingConfigurer {
private final int POOL_SIZE = 10; // 스레드 풀 사이즈
private final MovieService movieService;

@Scheduled(initialDelay=1000, fixedDelay=60000 * 5) // 5분 마다 수행
@Scheduled(initialDelay=1000, fixedDelay = 1000 * 60 * 60 * 24) // 24시간마다 실행
public void updateMovieList() {
try {
movieService.updateMovieList();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/WatchWithMe/global/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public class SecurityConfig {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.csrf(c -> c.disable())
.addFilterBefore(corsFilter, UsernamePasswordAuthenticationFilter.class)
.addFilterBefore(customJwtFilter, UsernamePasswordAuthenticationFilter.class)
.sessionManagement(c -> c.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.exceptionHandling(c -> {
c.authenticationEntryPoint(jwtAuthenticationEntryPoint).accessDeniedHandler(jwtAccessDeniedHandler);
Expand All @@ -58,6 +56,8 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.requestMatchers("/api/v1/admin/**").hasAuthority("ADMIN")
.anyRequest().authenticated();
});
http.addFilterBefore(customJwtFilter, UsernamePasswordAuthenticationFilter.class)
.addFilterBefore(corsFilter, UsernamePasswordAuthenticationFilter.class);

return http.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public CorsFilter corsFilter() {
config.addAllowedMethod("*");

source.registerCorsConfiguration("/api/**", config);
source.registerCorsConfiguration("/health", config);

return new CorsFilter((CorsConfigurationSource) source);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
SecurityContextHolder.getContext().setAuthentication(authentication);
log.info("Security Context에 " + authentication.getName() + "인증 정보를 저장했습니다. URI : " + requestURI);
} else {
log.info("유효한 JWT 토큰이 없습니다. URI: " + requestURI);
log.info("유효한 JWT 토큰이 없습니다. URI : " + requestURI);
}

chain.doFilter(request, response);
Expand Down

0 comments on commit de44c7b

Please sign in to comment.