Skip to content

Commit

Permalink
#144 #145 Fix missing attribute renamings
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Oct 12, 2018
1 parent 1da7c7e commit a3d49a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/org/thp/cortex/services/JobSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class JobSrv(
findForUser(userId, and(
dataTypeFilter.map("dataType" like _).toList :::
dataFilter.map("data" like _).toList :::
analyzerFilter.map(af or("analyzerId" like af, "analyzerName" like af)).toList), range, Nil)
analyzerFilter.map(af or("workerId" like af, "workerName" like af)).toList), range, Nil)
}

def findArtifacts(userId: String, jobId: String, queryDef: QueryDef, range: Option[String], sortBy: Seq[String]): (Source[Artifact, NotUsed], Future[Long]) = {
Expand Down Expand Up @@ -310,7 +310,7 @@ class JobSrv(
import org.elastic4play.services.QueryDSL._
val now = new Date().getTime
logger.info(s"Checking rate limit on worker ${worker.name()} from ${new Date(now - rateUnit.id.toLong * 24 * 60 * 60 * 1000)}")
stats(and("createdAt" ~>= (now - rateUnit.id.toLong * 24 * 60 * 60 * 1000), "analyzerId" ~= worker.id), Seq(selectCount)).map { s
stats(and("createdAt" ~>= (now - rateUnit.id.toLong * 24 * 60 * 60 * 1000), "workerId" ~= worker.id), Seq(selectCount)).map { s
val count = (s \ "count").as[Long]
logger.info(s"$count analysis found (limit is $rate)")
count < rate
Expand All @@ -330,7 +330,7 @@ class JobSrv(
logger.info(s"Looking for similar job (worker=${worker.id}, dataType=$dataType, data=$dataAttachment, tlp=$tlp, parameters=$parameters")
val now = new Date().getTime
find(and(
"analyzerId" ~= worker.id,
"workerId" ~= worker.id,
"status" ~!= JobStatus.Failure,
"status" ~!= JobStatus.Deleted,
"startDate" ~>= (now - cache.toMillis),
Expand Down

0 comments on commit a3d49a5

Please sign in to comment.