Lazy initialization of the json mapper (300ms)

pull/336/head
Vitor Pamplona 2023-04-05 08:45:33 -04:00
rodzic 924b21cdfc
commit 292ce779a1
1 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -17,9 +17,11 @@ import java.time.format.DateTimeFormatter
import java.util.concurrent.ConcurrentHashMap
object LocalCache {
val metadataParser = jacksonObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.readerFor(UserMetadata::class.java)
val metadataParser by lazy {
jacksonObjectMapper()
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.readerFor(UserMetadata::class.java)
}
val antiSpam = AntiSpamFilter()