Skip to content

Commit

Permalink
#1936 Disable index health check
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Apr 6, 2021
1 parent c18fb79 commit 233c925
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ScalliGraph
11 changes: 5 additions & 6 deletions thehive/app/org/thp/thehive/controllers/v1/AdminCtrl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import akka.util.Timeout
import org.thp.scalligraph.controllers.Entrypoint
import org.thp.scalligraph.models.Database
import org.thp.scalligraph.services.GenIntegrityCheckOps
import org.thp.scalligraph.traversal.TraversalOps._
import org.thp.thehive.models.Permissions
import org.thp.thehive.services.{CheckState, CheckStats, GetCheckStats, GlobalCheckRequest}
import play.api.Logger
Expand Down Expand Up @@ -72,12 +71,12 @@ class AdminCtrl @Inject() (
entrypoint("Get index status")
.authPermittedRoTransaction(db, Permissions.managePlatform) { _ => graph =>
val status = indexedModels.map { label =>
val mixedCount = graph.V(label).getCount
val compositeCount = graph.underlying.traversal().V().has("_label", label).count().next().toLong
// val mixedCount = graph.V(label).getCount
// val compositeCount = graph.underlying.traversal().V().has("_label", label).count().next().toLong
label -> Json.obj(
"mixedCount" -> mixedCount,
"compositeCount" -> compositeCount,
"status" -> (if (mixedCount == compositeCount) "OK" else "Error")
"mixedCount" -> -1,
"compositeCount" -> -1,
"status" -> "OK"
)
}
Success(Results.Ok(JsObject(status)))
Expand Down

0 comments on commit 233c925

Please sign in to comment.