Skip to content

Commit

Permalink
#2033 Fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed May 19, 2021
1 parent 8cba39d commit dba87a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 48 deletions.
43 changes: 0 additions & 43 deletions thehive/app/org/thp/thehive/IndexCleanup.scala

This file was deleted.

10 changes: 5 additions & 5 deletions thehive/app/org/thp/thehive/services/IntegrityCheckActor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class IntegrityCheckActor() extends Actor {

def duplicationCheck(name: String): Map[String, Long] = {
val startDate = System.currentTimeMillis()
val result = integrityCheckMap.get(name).fold(Map("checkNotFound" -> 1L))(_.duplicationCheck())
val result = integrityCheckMap.get(name).fold(Map("checkNotFound" -> 1L))(_.duplicationCheck().mapValues(_.toLong))
val endDate = System.currentTimeMillis()
result + ("startDate" -> startDate) + ("endDate" -> endDate) + ("duration" -> (endDate - startDate))
}
Expand All @@ -137,7 +137,7 @@ class IntegrityCheckActor() extends Actor {
.scheduleWithFixedDelay(initialDelay, interval) { () =>
logger.debug(s"Global check of ${integrityCheck.name}")
val startDate = System.currentTimeMillis()
val result = integrityCheck.globalCheck()
val result = integrityCheck.globalCheck().mapValues(_.toLong)
val duration = System.currentTimeMillis() - startDate
self ! GlobalCheckResult(integrityCheck.name, result + ("duration" -> duration))
}
Expand All @@ -159,7 +159,7 @@ class IntegrityCheckActor() extends Actor {
.scheduleWithFixedDelay(initialDelay, interval) { () =>
logger.debug(s"Global check of ${integrityCheck.name}")
val startDate = System.currentTimeMillis()
val result = integrityCheckMap.get(integrityCheck.name).fold(Map("checkNotFound" -> 1L))(_.globalCheck())
val result = integrityCheckMap.get(integrityCheck.name).fold(Map("checkNotFound" -> 1L))(_.globalCheck().mapValues(_.toLong))
val duration = System.currentTimeMillis() - startDate
self ! GlobalCheckResult(integrityCheck.name, result + ("duration" -> duration))
}
Expand Down Expand Up @@ -187,7 +187,7 @@ class IntegrityCheckActor() extends Actor {
Future {
logger.debug(s"Duplication check of $name")
val startDate = System.currentTimeMillis()
val result = integrityCheckMap.get(name).fold(Map("checkNotFound" -> 1L))(_.duplicationCheck())
val result = integrityCheckMap.get(name).fold(Map("checkNotFound" -> 1L))(_.duplicationCheck().mapValues(_.toLong))
val duration = System.currentTimeMillis() - startDate
self ! DuplicationCheckResult(name, result + ("duration" -> duration))
}(checkExecutionContext)
Expand All @@ -211,7 +211,7 @@ class IntegrityCheckActor() extends Actor {
Future {
logger.debug(s"Global check of $name")
val startDate = System.currentTimeMillis()
val result = integrityCheckMap.get(name).fold(Map("checkNotFound" -> 1L))(_.globalCheck())
val result = integrityCheckMap.get(name).fold(Map("checkNotFound" -> 1L))(_.globalCheck().mapValues(_.toLong))
val duration = System.currentTimeMillis() - startDate
self ! GlobalCheckResult(name, result + ("duration" -> duration))
}(checkExecutionContext)
Expand Down

0 comments on commit dba87a1

Please sign in to comment.