chore: Add additional debug logs

This commit is contained in:
2024-01-14 11:27:58 +01:00
parent d370524cc6
commit dbcc556bd2
@@ -38,6 +38,7 @@ class ScheduledTaskService(
@EventListener(ApplicationReadyEvent::class) @EventListener(ApplicationReadyEvent::class)
fun onApplicationReady(event: ApplicationReadyEvent) { fun onApplicationReady(event: ApplicationReadyEvent) {
if (!leaderProperties.isEnabled) { if (!leaderProperties.isEnabled) {
log.info { "Leader election disabled and application ready" }
val updateTime = Instant.ofEpochMilli(event.timestamp) val updateTime = Instant.ofEpochMilli(event.timestamp)
updateTaskCounterAndScheduleTasksIfLeader(updateTime) updateTaskCounterAndScheduleTasksIfLeader(updateTime)
} }
@@ -45,6 +46,7 @@ class ScheduledTaskService(
@EventListener(OnGrantedEvent::class) @EventListener(OnGrantedEvent::class)
fun onLeadershipGranted(event: OnGrantedEvent) { fun onLeadershipGranted(event: OnGrantedEvent) {
log.info { "Granted leadership" }
val updateTime = Instant.ofEpochMilli(event.timestamp) val updateTime = Instant.ofEpochMilli(event.timestamp)
updateTaskCounterAndScheduleTasksIfLeader(updateTime) updateTaskCounterAndScheduleTasksIfLeader(updateTime)
} }