Disable fmkorea

This commit is contained in:
woozu-shin 2024-05-16 08:28:45 +09:00
parent d9cf934eab
commit d6e623cf90
4 changed files with 7 additions and 51 deletions

View File

@ -1,40 +0,0 @@
package com.myoa.engineering.crawl.shopping.configuration.feign;
import feign.RequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class FmkoreaClientFeignConfiguration {
@Bean
public RequestInterceptor requestInterceptor() {
// TODO ignore 4xx
return requestTemplate -> new FakeUserAgentInterceptor().apply(requestTemplate);
}
@Bean
public FmkoreaClientErrorDecoder errorDecoder() {
return new FmkoreaClientErrorDecoder();
}
/*
@Bean
public FmkoreaBoardClient fmkoreaBoardClient(RateLimiterRegistry rateLimiterRegistry,
CircuitBreakerRegistry circuitBreakerRegistry,
RequestInterceptor requestInterceptor) {
FeignDecorators decorators = FeignDecorators.builder()
.withCircuitBreaker(circuitBreakerRegistry.circuitBreaker("rateLimit"))
.withRateLimiter(rateLimiterRegistry.rateLimiter("rateLimit"))
.build();
return Resilience4jFeign.builder(decorators)
.requestInterceptor(requestInterceptor)
.target(FmkoreaBoardClient.class, "https://www.fmkorea.com");
}
*/
}

View File

@ -1,12 +1,14 @@
package com.myoa.engineering.crawl.shopping.scheduler; package com.myoa.engineering.crawl.shopping.scheduler;
import com.myoa.engineering.crawl.shopping.crawlhandler.CrawlHandler; import com.myoa.engineering.crawl.shopping.crawlhandler.CrawlHandler;
import com.myoa.engineering.crawl.shopping.support.dto.constant.CrawlTarget;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Arrays;
import java.util.List; import java.util.List;
@Slf4j @Slf4j
@ -23,8 +25,9 @@ public class ParseEventEmitter {
@Scheduled(cron = "0 0/15 * * * ?") @Scheduled(cron = "0 0/15 * * * ?")
public void emit() { public void emit() {
log.info("[emit] trigger fired!"); crawlHandlers
crawlHandlers.forEach(CrawlHandler::handle); .stream()
.filter(e -> e.getCrawlTarget().isAvailable())
.forEach(CrawlHandler::handle);
} }
} }

View File

@ -33,13 +33,6 @@ public class UserNotifyService {
} }
} }
public ChatPostMessageRequest.ChatPostMessageRequestBuilder generateMessage(String message) {
return ChatPostMessageRequest.builder()
.channel(slackSecretProperties.getChannel())
.username(slackSecretProperties.getUsername())
.text(message);
}
public ChatPostMessageRequest.ChatPostMessageRequestBuilder generateMessage() { public ChatPostMessageRequest.ChatPostMessageRequestBuilder generateMessage() {
return ChatPostMessageRequest.builder() return ChatPostMessageRequest.builder()
.channel(slackSecretProperties.getChannel()) .channel(slackSecretProperties.getChannel())

View File

@ -8,7 +8,7 @@ import lombok.Getter;
public enum CrawlTarget { public enum CrawlTarget {
PPOMPPU_DOMESTIC("뽐뿌국내", true), PPOMPPU_DOMESTIC("뽐뿌국내", true),
PPOMPPU_OVERSEA("뽐뿌해외", true), PPOMPPU_OVERSEA("뽐뿌해외", true),
FMKOREA("펨코", true), FMKOREA("펨코", false),
; ;
private final String alias; private final String alias;