Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions app/Global.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ import play.api.libs.concurrent.Execution.Implicits.defaultContext

import java.io.File
import scala.concurrent._
import scala.concurrent.duration._

import akka.actor.ActorSystem
import play.api.libs.concurrent.Akka

/** Application global object, serves to control startup and control cross-cutting concerns */
object Global extends WithFilters(LoggingFilter) with Response {
Expand Down Expand Up @@ -68,6 +72,16 @@ object Global extends WithFilters(LoggingFilter) with Response {
Logger.error(s"$peers not a directory")
System.exit(1)
}

val actorSystem = Akka.system(app)
val ec = actorSystem.dispatcher

actorSystem.scheduler.schedule(
initialDelay = 10.seconds,
interval = 10.seconds
)(() => {
println("Executing something (Global)...")
})(ec)
}

/** global error handler */
Expand Down
7 changes: 6 additions & 1 deletion app/models/Models.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import play.api.db.slick.Config.driver.simple._
import scala.slick.lifted.Tag
import play.api.libs.json._

import org.apache.commons.text.StringEscapeUtils
import java.sql.Timestamp
import java.util.Date

Expand Down Expand Up @@ -861,7 +862,11 @@ case class Question(
url => (url.url == "true" && url.title == "isCategoryList")
}.length > 0
}
.map { answer => answer.text.replace("&", "&").replace("+", "+") }
.map { answer =>
answer.copy(
text = StringEscapeUtils.unescapeHtml4(answer.text)
)
}
.toSet
assert(
categoryNames == answerCategoryNames,
Expand Down
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ libraryDependencies ++= Seq(
jdbc,
cache,
ws,
"org.apache.commons" % "commons-text" % "1.10.0",
"com.typesafe.play" %% "play-slick" % "0.8.0",
"org.postgresql" % "postgresql" % "42.7.2",
"org.bouncycastle" % "bcprov-jdk15to18" % "1.76",
Expand Down
Loading