Skip to content

Commit

Permalink
#1731 Remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jan 28, 2021
1 parent 172a5d3 commit 5331e4c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ class DBConfiguration @Inject() (
/**
* Creates a Source (akka stream) from the result of the search
*/
def source(searchRequest: SearchRequest)(implicit ec: ExecutionContext): Source[SearchHit, NotUsed] =
def source(searchRequest: SearchRequest): Source[SearchHit, NotUsed] =
Source.fromPublisher(client.publisher(searchRequest))

/**
* Create a Sink (akka stream) that create entity in ElasticSearch
*/
def sink[T](implicit builder: RequestBuilder[T], ec: ExecutionContext): Sink[T, Future[Unit]] = {
def sink[T](implicit builder: RequestBuilder[T]): Sink[T, Future[Unit]] = {
val sinkListener = new ResponseListener[T] {
override def onAck(resp: BulkResponseItem, original: T): Unit = ()

Expand Down
13 changes: 10 additions & 3 deletions thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,23 @@ class TheHiveSchemaDefinition @Inject() extends Schema with UpdatableSchema {
)
)
.foreach {
case (tag, Some(freeTagsTaxo)) =>
case (tag, Some(freetagsTaxo)) =>
val tagStr = tagString(
tag.property[String]("namespace").value(),
tag.property[String]("predicate").value(),
tag.property[String]("value").orElse("")
)
tag.property("namespace", freeTagsTaxo.property[String]("namespace").value)
tag.property("namespace", freetagsTaxo.property[String]("namespace").value)
tag.property("predicate", tagStr)
tag.property("value").remove()
freeTagsTaxo.addEdge("TaxonomyTag", tag)
freetagsTaxo.addEdge("TaxonomyTag", tag)
case (tag, None) =>
val tagStr = tagString(
tag.property[String]("namespace").value(),
tag.property[String]("predicate").value(),
tag.property[String]("value").orElse("")
)
logger.warn(s"Tag $tagStr is not linked to any organisation")
}
Success(())
}
Expand Down

0 comments on commit 5331e4c

Please sign in to comment.