Skip to content

Commit

Permalink
#110 Fix analyzer/worker
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jul 11, 2018
1 parent cedddb4 commit ec2db81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/org/thp/cortex/controllers/JobCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class JobCtrl @Inject() (
implicit val mat: Materializer,
implicit val actorSystem: ActorSystem) extends AbstractController(components) with Status {

def list(dataTypeFilter: Option[String], dataFilter: Option[String], analyzerFilter: Option[String], range: Option[String]): Action[AnyContent] = authenticated(Roles.read).async { implicit request
val (jobs, jobTotal) = jobSrv.listForUser(request.userId, dataTypeFilter, dataFilter, analyzerFilter, range)
def list(dataTypeFilter: Option[String], dataFilter: Option[String], workerFilter: Option[String], range: Option[String]): Action[AnyContent] = authenticated(Roles.read).async { implicit request
val (jobs, jobTotal) = jobSrv.listForUser(request.userId, dataTypeFilter, dataFilter, workerFilter, range)
renderer.toOutput(OK, jobs, jobTotal)
}

Expand Down
10 changes: 5 additions & 5 deletions app/org/thp/cortex/services/JobSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ class JobSrv(
})
}

def create(analyzerId: String, fields: Fields)(implicit authContext: AuthContext): Future[Job] = {
workerSrv.getForUser(authContext.userId, analyzerId).flatMap { worker
def create(workerId: String, fields: Fields)(implicit authContext: AuthContext): Future[Job] = {
workerSrv.getForUser(authContext.userId, workerId).flatMap { worker
/*
In Cortex 1, fields looks like:
{
Expand Down Expand Up @@ -257,9 +257,9 @@ class JobSrv(
case None isUnderRateLimit(worker).flatMap {
case true
val fields = Fields(Json.obj(
"analyzerDefinitionId" -> worker.workerDefinitionId(),
"analyzerId" -> worker.id,
"analyzerName" -> worker.name(),
"workerDefinitionId" -> worker.workerDefinitionId(),
"workerId" -> worker.id,
"workerName" -> worker.name(),
"organization" -> worker.parentId,
"status" -> JobStatus.Waiting,
"dataType" -> dataType,
Expand Down

0 comments on commit ec2db81

Please sign in to comment.