41 lines
1.2 KiB
Java
41 lines
1.2 KiB
Java
package com.myoa.engineering.crawl.ppomppu.receiver.shceduler;
|
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import com.myoa.engineering.crawl.ppomppu.receiver.service.ProcessorAPIService;
|
|
import com.myoa.engineering.crawl.ppomppu.support.dto.code.PpomppuBoardName;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
/**
|
|
* ParseEventEmitter
|
|
* @author Shin Woo-jin (woo-jin.shin@linecorp.com)
|
|
* @since 2021-09-05
|
|
*
|
|
*/
|
|
@Slf4j
|
|
@Component
|
|
@EnableScheduling
|
|
public class ParseEventEmitter {
|
|
|
|
private final ProcessorAPIService processorAPIService;
|
|
|
|
public ParseEventEmitter(ProcessorAPIService processorAPIService) {
|
|
this.processorAPIService = processorAPIService;
|
|
}
|
|
|
|
@Scheduled(fixedRate = 60 * 1000L)
|
|
public void emitDomesticBoard() {
|
|
log.info("[emitDomesticBoard] trigger fired!");
|
|
processorAPIService.emitParseEvent(PpomppuBoardName.PPOMPPU_DOMESTIC).block();
|
|
}
|
|
|
|
@Scheduled(fixedRate = 300 * 1000L)
|
|
public void emitOverseaBoard() {
|
|
log.info("[emitOverseaBoard] trigger fired!");
|
|
processorAPIService.emitParseEvent(PpomppuBoardName.PPOMPPU_OVERSEA).block();
|
|
}
|
|
}
|