Skip to content

Commit

Permalink
fix: #92 yml 파일 및 consumer 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
KarmaPol committed Mar 21, 2024
1 parent 7d937b5 commit db51725
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion infra/infra-lambda/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jpa")

// lambda
implementation("org.springframework.cloud:spring-cloud-function-web")
implementation("org.springframework.cloud:spring-cloud-function-web:4.1.0")
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class LambdaConsumer(private val questionRepository: QuestionRepository,
private fun updateBundlesPopularity() {
val bundles = bundleRepository.findAll()
bundles.forEach { bundle ->
val hours = ChronoUnit.HOURS.between(LocalDateTime.now(), bundle.createdAt).toDouble()
val hours = ChronoUnit.HOURS.between(bundle.createdAt, LocalDateTime.now()).toDouble()
val popularity = getBundlePopularity(bundle, hours)
bundle.updatePopularity(popularity)
}
Expand All @@ -42,7 +42,7 @@ class LambdaConsumer(private val questionRepository: QuestionRepository,
private fun updateQuestionPopularity() {
val questions = questionRepository.findAll()
questions.forEach { question ->
val hours = ChronoUnit.HOURS.between(LocalDateTime.now(), question.createdAt).toDouble()
val hours = ChronoUnit.HOURS.between(question.createdAt, LocalDateTime.now()).toDouble()
val popularity = getQuestionPopularity(question, hours)
question.updatePopularity(popularity)
}
Expand Down

This file was deleted.

4 changes: 4 additions & 0 deletions infra/infra-lambda/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
spring:
profiles:
include: rdb
active: dev

0 comments on commit db51725

Please sign in to comment.