]> Entropealabs - cluster_kv.git/commitdiff
just insert
authorChristopher <chris@entropealabs.com>
Sun, 8 Mar 2020 04:56:10 +0000 (22:56 -0600)
committerChristopher <chris@entropealabs.com>
Sun, 8 Mar 2020 04:56:10 +0000 (22:56 -0600)
lib/cluster_kv/db.ex

index f7ff6560866c4f232cd08e7446701250fe753c77..ca8eae5875a162f36e7a2ff4845a4cadbb47f2fd 100644 (file)
@@ -92,7 +92,7 @@ defmodule ClusterKV.DB do
         {[], 0}
 
       lb ->
-        Process.send_after(self(), :process_batch, 0)
+        Process.send_after(self(), :process_batch, 10)
         {batch, lb}
     end
   end
@@ -110,7 +110,7 @@ defmodule ClusterKV.DB do
 
       [{_, val} = old] when is_list(val) ->
         new = fun.(old, value)
-        1 = :ets.select_replace(db, [{old, [], [{:const, new}]}])
+        1 = :ets.insert(db, new)
 
       [_] ->
         :ets.insert(db, {key, [value]})