Skip to content

Commit

Permalink
#110 Fix variable names (analyzer/worker)
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jul 23, 2018
1 parent 9c25ca0 commit eb46e97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions app/org/thp/cortex/controllers/JobCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ class JobCtrl @Inject() (
.map(_ NoContent)
}

def create(analyzerId: String): Action[Fields] = authenticated(Roles.analyze).async(fieldsBodyParser) { implicit request
jobSrv.create(analyzerId, request.body)
def create(workerId: String): Action[Fields] = authenticated(Roles.analyze).async(fieldsBodyParser) { implicit request
jobSrv.create(workerId, request.body)
.map { job
renderer.toOutput(OK, job)
}
Expand Down Expand Up @@ -133,7 +133,6 @@ class JobCtrl @Inject() (
jobSrv.getForUser(request.userId, jobId)
.flatMap {
case job if job.status() == JobStatus.InProgress || job.status() == JobStatus.Waiting
println(s"job status is ${job.status()} ⇒ wait")
val duration = Duration(atMost).asInstanceOf[FiniteDuration]
implicit val timeout: Timeout = Timeout(duration)
(auditActor ? Register(jobId, duration))
Expand All @@ -142,7 +141,6 @@ class JobCtrl @Inject() (
.withTimeout(duration, ())
.flatMap(_ getJobWithReport(request.userId, jobId))
case job
println(s"job status is ${job.status()} ⇒ send it directly")
getJobWithReport(request.userId, job)
}
.map(Ok(_))
Expand Down
4 changes: 2 additions & 2 deletions app/org/thp/cortex/services/WorkerSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ class WorkerSrv(
def create(organizationId: String, workerDefinition: WorkerDefinition, workerFields: Fields)(implicit authContext: AuthContext): Future[Worker] = {
for {
organization organizationSrv.get(organizationId)
analyzer create(organization, workerDefinition, workerFields)
} yield analyzer
worker create(organization, workerDefinition, workerFields)
} yield worker
}

def delete(analyzer: Worker)(implicit authContext: AuthContext): Future[Unit] =
Expand Down

0 comments on commit eb46e97

Please sign in to comment.