Skip to content

Commit

Permalink
Changed CrawlerServices scope (no point in being singleton)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Gomes authored and David Gomes committed Jan 9, 2022
1 parent 1d491d9 commit 9a49936
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 9a49936

Please sign in to comment.