disable snapshot as it's memory consume

This commit is contained in:
Tienson Qin
2026-01-08 23:20:31 +08:00
parent e8f2d2d7e1
commit 887c0cc481
2 changed files with 12 additions and 11 deletions

View File

@@ -185,14 +185,14 @@
:t (t-now self)
:txs txs}))
;; FIXME: memory limit
(defn- snapshot-response [^js self]
(let [conn (.-conn self)
db @conn
datoms (protocol/datoms->wire (d/datoms db :eavt))]
{:type "snapshot/ok"
:t (t-now self)
:datoms (common/write-transit datoms)}))
;; FIXME: memory limit, should re-download graph using sqlite table rows
;; (defn- snapshot-response [^js self]
;; (let [conn (.-conn self)
;; db @conn
;; datoms (protocol/datoms->wire (d/datoms db :eavt))]
;; {:type "snapshot/ok"
;; :t (t-now self)
;; :datoms (common/write-transit datoms)}))
(defn- import-snapshot! [^js self rows reset?]
(let [sql (.-sql self)]
@@ -302,8 +302,8 @@
(let [since (or (:since message) 0)]
(send! ws (pull-response self since)))
"snapshot"
(send! ws (snapshot-response self))
;; "snapshot"
;; (send! ws (snapshot-response self))
"tx"
(let [tx-data (protocol/transit->tx (:tx message))

View File

@@ -31,8 +31,9 @@ Client -> Server:
- `{ "type": "hello", "client": "...", "since": 0 }`
- `{ "type": "tx", "client": "...", "t_before": 0, "tx": "<transit>" }`
- `{ "type": "pull", "since": 0 }`
- `{ "type": "snapshot" }`
- `{ "type": "ping" }`
<!-- - `{ "type": "snapshot" }` -->
Server -> Client: