Skip to content

Commit

Permalink
The ElasticIndexer should never be asked to index an empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwlchan committed Oct 20, 2020
1 parent 8163184 commit 8e0cafd
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -22,6 +22,7 @@ class ElasticIndexer[T: Indexable](
new ElasticsearchIndexCreator(client, index, config).create

final def index(documents: Seq[T]): Future[Either[Seq[T], Seq[T]]] = {
assert(documents.nonEmpty, "Cannot index an empty list of documents")

debug(s"Indexing ${documents.map(doc => indexable.id(doc)).mkString(", ")}")

Expand Down

0 comments on commit 8e0cafd

Please sign in to comment.