From a3d49a54058e0c61cf420f25ac2b079ee3a07bd6 Mon Sep 17 00:00:00 2001 From: To-om Date: Fri, 12 Oct 2018 10:42:50 +0200 Subject: [PATCH] #144 #145 Fix missing attribute renamings --- app/org/thp/cortex/services/JobSrv.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/org/thp/cortex/services/JobSrv.scala b/app/org/thp/cortex/services/JobSrv.scala index 5e36466f8..829771955 100644 --- a/app/org/thp/cortex/services/JobSrv.scala +++ b/app/org/thp/cortex/services/JobSrv.scala @@ -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]) = { @@ -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 @@ -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),