From 9a499367f08fefb8f75e408677209a6e0f504659 Mon Sep 17 00:00:00 2001 From: David Gomes Date: Sun, 9 Jan 2022 15:29:29 +0000 Subject: [PATCH] Changed CrawlerServices scope (no point in being singleton) --- .../pensador/service/crawler/GoodReadsCrawlerService.kt | 4 ++-- .../pensador/service/crawler/PensadorCrawlerService.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/me/l3n/bot/discord/pensador/service/crawler/GoodReadsCrawlerService.kt b/src/main/kotlin/me/l3n/bot/discord/pensador/service/crawler/GoodReadsCrawlerService.kt index 064772c..181e307 100644 --- a/src/main/kotlin/me/l3n/bot/discord/pensador/service/crawler/GoodReadsCrawlerService.kt +++ b/src/main/kotlin/me/l3n/bot/discord/pensador/service/crawler/GoodReadsCrawlerService.kt @@ -6,14 +6,14 @@ import org.eclipse.microprofile.config.inject.ConfigProperty import org.jsoup.nodes.Document import org.jsoup.nodes.Element import org.jsoup.select.Elements -import javax.inject.Singleton +import javax.enterprise.context.ApplicationScoped private val EXTRACT_QUOTE_REGEX = "(?<=“)(.*?)(?=”)".toRegex(RegexOption.DOT_MATCHES_ALL) private val AUTHOR_NAME_REPLACE_REGEX = "[^A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ' .,]+|,\$".toRegex() @LookupIfProperty(name = "source", stringValue = "goodreads", lookupIfMissing = true) -@Singleton +@ApplicationScoped class GoodReadsCrawlerService : CrawlerService() { @ConfigProperty(name = "url.goodreads-quotes") diff --git a/src/main/kotlin/me/l3n/bot/discord/pensador/service/crawler/PensadorCrawlerService.kt b/src/main/kotlin/me/l3n/bot/discord/pensador/service/crawler/PensadorCrawlerService.kt index 22648e7..acccb74 100644 --- a/src/main/kotlin/me/l3n/bot/discord/pensador/service/crawler/PensadorCrawlerService.kt +++ b/src/main/kotlin/me/l3n/bot/discord/pensador/service/crawler/PensadorCrawlerService.kt @@ -7,10 +7,10 @@ import me.l3n.bot.discord.pensador.util.toPlainText import org.jsoup.nodes.Document import org.jsoup.nodes.Element import org.jsoup.select.Elements -import javax.inject.Singleton +import javax.enterprise.context.ApplicationScoped @LookupIfProperty(name = "source", stringValue = "pensador") -@Singleton +@ApplicationScoped class PensadorCrawlerService( private val urlConfig: PensadorUrlConfig, ) : CrawlerService() {