How disable ecto insert cache?

Viewed 194

My app inserts millions records. Every second size ets data table increases on several mb.

In deps/ecto/lib/ecto/query/planner.ex I find cache_insert function that inserts data to ets. How to disable this behaviour?

My function for insert:

defp to_cache(links) do
    recs =
    Enum.uniq(links)
    |> Enum.filter(fn (link) -> (link != nil and link != "") end)
    |> Enum.map(fn link -> %{link: link}  end)
    |> Enum.each(fn link ->
         %Crawler.MongoLinks{}
            |> Crawler.MongoLinks.changeset(link)
            |> Crawler.MongoRepo.insert()
     end)
end

link is struct like %Crawler.Links{link: "http://example.com/page.html"}

0 Answers
Related