mirror of
https://github.com/logseq/logseq.git
synced 2026-05-19 18:32:41 +00:00
fix: download doesn't cleanup temp db
This commit is contained in:
@@ -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?))
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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}))))
|
||||
|
||||
Reference in New Issue
Block a user