diff --git a/migration/src/main/scala/org/thp/thehive/migration/th3/DBConfiguration.scala b/migration/src/main/scala/org/thp/thehive/migration/th3/DBConfiguration.scala index ebb6d9f032..d178796e3e 100644 --- a/migration/src/main/scala/org/thp/thehive/migration/th3/DBConfiguration.scala +++ b/migration/src/main/scala/org/thp/thehive/migration/th3/DBConfiguration.scala @@ -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 = () diff --git a/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala b/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala index b93c1c69f9..d52768c3bc 100644 --- a/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala +++ b/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala @@ -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(()) }