Skip to content

Commit

Permalink
feat: 스케줄러 수정 (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
injoon2019 authored Oct 3, 2024
1 parent c622bf8 commit 5fcd36a
Showing 1 changed file with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ class StatisticsScheduler(
"type" to "mrkdwn",
"text" to """
지표 물어다주는 새 :bird:
전체 유저: ${currentUser}
어제 가입 유저: ${yesterdayRegisterUser}
어제 탈퇴 유저: ${yesterdayLeaveUser}
어제 핑퐁 시작 유저: ${yesterdayStartPingpong}
전체 유저: ${currentUser.count()}
어제 가입 유저: ${yesterdayRegisterUser.count()}
어제 탈퇴 유저: ${yesterdayLeaveUser.count()}
어제 핑퐁 시작 유저: ${yesterdayStartPingpong.count()}
""".trimIndent()
)
)
Expand All @@ -76,14 +76,14 @@ class StatisticsScheduler(

log.info { "Sending request to Slack: ${ObjectMapper().writeValueAsString(request)}" }

// val response = webClient.post()
// .contentType(MediaType.APPLICATION_JSON)
// .body(BodyInserters.fromValue(request))
// .retrieve()
// .bodyToMono(String::class.java)
// .block()
//
// log.info { "response: $response" }
val response = webClient.post()
.contentType(MediaType.APPLICATION_JSON)
.body(BodyInserters.fromValue(request))
.retrieve()
.bodyToMono(String::class.java)
.block()

log.info { "response: $response" }
}

@Scheduled(cron = "* * 10 * * 1")
Expand Down Expand Up @@ -121,11 +121,11 @@ class StatisticsScheduler(
)
)

// val response = webClient.post()
// .contentType(MediaType.APPLICATION_JSON)
// .body(BodyInserters.fromValue(request))
// .retrieve()
// .bodyToMono(String::class.java)
// .block()
val response = webClient.post()
.contentType(MediaType.APPLICATION_JSON)
.body(BodyInserters.fromValue(request))
.retrieve()
.bodyToMono(String::class.java)
.block()
}
}

0 comments on commit 5fcd36a

Please sign in to comment.