]> Entropealabs - cluster_kv.git/commitdiff
just do an insert on batch processing
authorChristopher <chris@entropealabs.com>
Thu, 16 Apr 2020 14:26:17 +0000 (09:26 -0500)
committerChristopher <chris@entropealabs.com>
Thu, 16 Apr 2020 14:26:17 +0000 (09:26 -0500)
lib/cluster_kv/db.ex

index a73c1561f086dbc9e3bc90dabccae96222281c2d..a1d0b8e006bfa0cdd48d0ec77d910a8f5faedcd4 100644 (file)
@@ -136,13 +136,14 @@ defmodule ClusterKV.DB do
           last_batch :: integer(),
           fun :: fun()
         ) :: {[element()], integer(), reference()}
-  defp handle_next_batch_chunk(db, batch, chunk, last_batch, fun) do
+  defp handle_next_batch_chunk(db, batch, chunk, last_batch, _fun) do
     Logger.debug("processing batch of #{length(batch)} from #{last_batch} with chunk of #{chunk}")
 
     batch
     |> Enum.slice(last_batch, chunk)
-    |> Enum.each(fn {k, v} ->
-      do_upsert(db, k, v, fun)
+    |> Enum.each(fn {_k, _v} = v ->
+      :ets.insert(db, v)
+      # do_upsert(db, k, v, fun)
     end)
 
     case last_batch + chunk do