Skip to content

Commit

Permalink
Merge pull request #4 from kusitms-28th-Meetup-E/feat/batch
Browse files Browse the repository at this point in the history
fix (#1) : scheduled delay of 10 seconds
  • Loading branch information
eojinny authored Nov 14, 2023
2 parents c4c15b6 + 2847cda commit 6d28c58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ public String naverAPI(String name) throws JsonProcessingException {
e.printStackTrace();
}
}
try {
Thread.sleep(1000); // 100 milliseconds delay
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}

return rslt.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class MorphemeController {
private final NewsAPIService newsAPIService;
private final MorphemeService morphemeService;
//@GetMapping("/analysis/{msg}")
@Scheduled(cron = "* * * * * 2")
@Scheduled(cron = "* * * * * 2" , fixedDelay = 30000)
public String analysis() throws JsonProcessingException {
String newsList1 = newsAPIService.naverAPI("주 69시간 근로시간 제도 개편");
String newsList2 = newsAPIService.naverAPI("이태원 참사");
Expand Down

0 comments on commit 6d28c58

Please sign in to comment.