From: Christopher Date: Sun, 8 Mar 2020 04:56:10 +0000 (-0600) Subject: just insert X-Git-Url: http://git.entropealabs.com/?a=commitdiff_plain;h=9ee856ab1cf7964c0296510f4a6995c8ecd66fbd;p=cluster_kv.git just insert --- diff --git a/lib/cluster_kv/db.ex b/lib/cluster_kv/db.ex index f7ff656..ca8eae5 100644 --- a/lib/cluster_kv/db.ex +++ b/lib/cluster_kv/db.ex @@ -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]})