fix: download doesn't cleanup temp db

This commit is contained in:
Tienson Qin
2026-04-22 11:46:09 +08:00
parent d0ea93a867
commit 32eeb5ae67
3 changed files with 3 additions and 18 deletions

View File

@@ -580,10 +580,6 @@
[repo]
(db-sync/upload-stopped? repo))
(def-thread-api :thread-api/db-sync-download-graph
[repo]
(sync-download/download-graph! repo))
(def-thread-api :thread-api/db-sync-download-graph-by-id
[repo graph-id graph-e2ee?]
(sync-download/download-graph-by-id! repo graph-id graph-e2ee?))

View File

@@ -237,11 +237,9 @@
(fs/writeFile full-path (->buffer data)))))
(defn- remove-vfs!
[write-guard-fn ^js pool]
[^js pool]
(when pool
(p/let [_ (when write-guard-fn
(write-guard-fn))]
(fs/rm (.-repoDir pool) #js {:recursive true :force true}))))
(fs/rm (.-repoDir pool) #js {:recursive true :force true})))
(defn- read-text!
[data-dir path]
@@ -411,7 +409,7 @@
(pool-path pool path))
:export-file export-file
:import-db (fn [pool path data] (import-db write-guard-fn pool path data))
:remove-vfs! (fn [pool] (remove-vfs! write-guard-fn pool))
:remove-vfs! (fn [pool] (remove-vfs! pool))
:read-text! (fn [path] (read-text! data-dir path))
:write-text! (fn [path text] (write-text! write-guard-fn data-dir path text))
:asset-read-bytes! (fn [repo file-name]

View File

@@ -527,12 +527,3 @@
{:repo repo
:graph-id graph-id
:base base})))))
(defn download-graph!
[repo]
(if-let [graph-id (client-op/get-graph-uuid repo)]
(download-graph-by-id! repo graph-id (sync-crypt/graph-e2ee? repo))
(p/rejected (ex-info "db-sync missing graph id"
{:repo repo
:type :db-sync/missing-field
:field :graph-id}))))