in dsl/kotless/cloud/kotless-lang-aws/src/main/kotlin/io/kotless/dsl/app/events/EventsDispatcher.kt [14:31]
fun process(event: CloudWatch) {
for (resource in event.resources.map { it.substringAfter("/") }) {
when {
resource.contains(ScheduledEventType.Autowarm.prefix) -> {
logger.trace("Executing warmup sequence")
Application.warmup()
logger.trace("Warmup sequence executed")
}
resource.contains(ScheduledEventType.General.prefix) -> {
val key = resource.substring(resource.lastIndexOf(ScheduledEventType.General.prefix))
logger.trace("Executing scheduled lambda with key $key")
EventsStorage[key]?.let { FunctionCaller.call(it, emptyMap()) }
logger.trace("Scheduled lambda with key $key was executed")
}
}
}
}