Skip to content

Commit

Permalink
Added a case when the stream is stopped like with Enum.take
Browse files Browse the repository at this point in the history
  • Loading branch information
GRoguelon committed Apr 4, 2024
1 parent 2da7a47 commit c6746ef
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/elasticsearch_ex/stream.ex
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ defmodule ElasticsearchEx.Stream do
end
end

@spec after_fun(acc()) :: :ok
defp after_fun({pit, _search_after}), do: after_fun(pit)

@spec after_fun(pit()) :: :ok
defp after_fun(%{id: pit_id}) do
case SearchApi.close_pit(pit_id) do
Expand Down

0 comments on commit c6746ef

Please sign in to comment.