fix empty buffered task

current fetcher do not process new items
when they were added after initial records from
db were processed.

This PR fixes it.
pull/2899/head
Ayrat Badykov 5 years ago
parent cd27d9e09a
commit 032a3990b1
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 9
      apps/indexer/lib/indexer/buffered_task.ex

@ -434,8 +434,13 @@ defmodule Indexer.BufferedTask do
end
end
# was shrunk and out of work, get more work from `init/2`
defp schedule_next(%BufferedTask{bound_queue: %BoundQueue{size: 0, maximum_size: maximum_size}} = state)
# was out of work, get more work from `init/2`
defp schedule_next(%BufferedTask{bound_queue: %BoundQueue{size: 0}} = state) do
do_initial_stream(state)
end
# was shrunk, get more work from `init/2`
defp schedule_next(%BufferedTask{bound_queue: %BoundQueue{maximum_size: maximum_size}} = state)
when maximum_size != nil do
Logger.info(fn ->
[

Loading…
Cancel
Save