call the evaluator with the API token
This commit is contained in:
parent
131555cb57
commit
31b7c1b2e4
|
@ -12,13 +12,15 @@ final class Env(
|
|||
private val CollectionEvaluation = config getString "collection.evaluation"
|
||||
private val EvaluatorScriptPath = config getString "evaluator.script_path"
|
||||
private val ActorName = config getString "actor.name"
|
||||
private val ApiToken = config getString "api.token"
|
||||
|
||||
lazy val evaluator = new Evaluator(
|
||||
coll = db(CollectionEvaluation),
|
||||
script = EvaluatorScriptPath,
|
||||
reporter = hub.actor.report,
|
||||
analyser = hub.actor.analyser,
|
||||
marker = hub.actor.mod)
|
||||
marker = hub.actor.mod,
|
||||
token = ApiToken)
|
||||
|
||||
system.actorOf(Props(new Listener(evaluator)), name = ActorName)
|
||||
}
|
||||
|
|
|
@ -21,7 +21,8 @@ final class Evaluator(
|
|||
script: String,
|
||||
reporter: ActorSelection,
|
||||
analyser: ActorSelection,
|
||||
marker: ActorSelection) {
|
||||
marker: ActorSelection,
|
||||
token: String) {
|
||||
|
||||
import Evaluation._
|
||||
|
||||
|
@ -105,7 +106,7 @@ final class Evaluator(
|
|||
}
|
||||
|
||||
private def run(userId: String, deep: Boolean): Try[String] = {
|
||||
val command = s"""$script $userId ${deep ?? "true"}"""
|
||||
val command = s"""$script $userId ${deep.fold("true", "false")} $token""".pp
|
||||
Try {
|
||||
import scala.sys.process._
|
||||
command!!
|
||||
|
|
Loading…
Reference in a new issue