in src/main/kotlin/jetbrains/buildServer/notification/slackNotifier/logging/ThrottlingLogger.kt [27:38]
fun warn(message: String) {
lastTimeMessageWasSent.compute(message) { _, lastTime ->
val now = currentTimeInNanos()
val timeout = TeamCityProperties.getLong(SlackNotifierProperties.loggerThrottleTimeout, 60)
if (now - (lastTime ?: defaultLastTime) > TimeUnit.MINUTES.toNanos(timeout)) {
logger.warn(message)
now
} else {
lastTime
}
}
}