Skip to content

Commit

Permalink
Fix live event polling interval
Browse files Browse the repository at this point in the history
  • Loading branch information
anssip committed Dec 7, 2023
1 parent a15b60c commit d329deb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion application/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ logging:
level:
com:
npd:
betting: debug
betting: DEBUG
mysql:
cj: info
reactor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ open class EventImporter(private val props: Props, private val service: EventSer
}
}

@Scheduled(fixedRate = 60, timeUnit = java.util.concurrent.TimeUnit.MINUTES) // Poll the API every 10 minutes
@Scheduled(fixedRate = 10, timeUnit = java.util.concurrent.TimeUnit.MINUTES) // Poll the API every 10 minutes
@Transactional
open fun importEvents() {
runBlocking {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ open class LiveEventImporter(
val liveEvents = withContext(Dispatchers.IO) {
eventRepository.findByIsLiveTrueAndCompletedFalse()
}
logger.debug("Found ${liveEvents.size} live events")
logger.info("Found ${liveEvents.size} live events")

val eventData = fetchEvents(liveEvents)
logger.debug("Fetched ${eventData.size} events from bets-api.com")
logger.info("Fetched ${eventData.size} events from bets-api.com")

val notfound = eventData.mapNotNull { it.second }
notfound.forEach() {
Expand Down

0 comments on commit d329deb

Please sign in to comment.