chore: remove batch fn

pull/1672/head
Tienson Qin 2021-04-16 00:09:06 +08:00
parent a884c84f20
commit cae6553a73
1 changed files with 0 additions and 16 deletions

View File

@ -32,19 +32,3 @@
(async/put! write-chan page-db-id))
(util/batch write-chan batch-write-interval write-files!)
(defn batch [in max-time handler]
(async/go-loop [buf [] t (async/timeout max-time)]
(let [[v p] (async/alts! [in t])]
(cond
(= p t)
(do
(handler buf)
(recur [] (async/timeout max-time)))
(nil? v) ; stop
(when (seq buf)
(handler buf))
:else
(recur (conj buf v) t)))))