Ver Fonte

chore: remove deprecated fns

rcmerci há 1 ano atrás
pai
commit
a504100659

+ 0 - 21
src/main/frontend/db_worker.cljs

@@ -575,27 +575,6 @@
          :target-user-uuids target-user-uuids
          :target-user-emails target-user-emails)))))
 
-  (rtc-upload-graph
-   [this repo token remote-graph-name]
-   (let [d (p/deferred)]
-     (when-let [conn (worker-state/get-datascript-conn repo)]
-       (async/go
-         (try
-           (let [state (<? (rtc-core/<init-state repo token false))]
-             (<? (rtc-updown/<upload-graph state repo conn remote-graph-name))
-             (rtc-db-listener/listen-db-to-generate-ops repo conn)
-             (p/resolve! d :success))
-           (worker-util/post-message :notification
-                                     [[:div
-                                       [:p "Upload graph successfully"]]])
-           (catch :default e
-             (worker-util/post-message :notification
-                                       [[:div
-                                         [:p "upload graph failed"]]
-                                        :error])
-             (p/reject! d e)))))
-     d))
-
   (rtc-async-upload-graph
    [this repo token remote-graph-name]
    (let [d (p/deferred)]

+ 0 - 29
src/main/frontend/worker/rtc/full_upload_download_graph.cljs

@@ -39,35 +39,6 @@
                     {:db/id (:e (first datoms))}
                     datoms)))))))
 
-(defn <upload-graph
-  "Upload current repo to remote, return remote {:req-id xxx :graph-uuid <new-remote-graph-uuid>}"
-  [state repo conn remote-graph-name]
-  (go
-    (let [{:keys [url key all-blocks-str]}
-          (with-sub-data-from-ws state
-            (<? (<send! state {:req-id (get-req-id) :action "presign-put-temp-s3-obj"}))
-            (let [all-blocks (export-as-blocks @conn)
-                  all-blocks-str (transit/write (transit/writer :json) all-blocks)]
-              (merge (<! (get-result-ch)) {:all-blocks-str all-blocks-str})))]
-      (<! (http/put url {:body all-blocks-str}))
-      (let [r (<? (ws/<send&receive state {:action "full-upload-graph"
-                                           :s3-key key
-                                           :graph-name remote-graph-name}))]
-        (if-not (:graph-uuid r)
-          (ex-info "upload graph failed" r)
-          (let [^js worker-obj (:worker/object @worker-state/*state)]
-            (d/transact! conn
-                         [{:db/ident :logseq.kv/graph-uuid :graph/uuid (:graph-uuid r)}
-                          {:db/ident :logseq.kv/graph-local-tx :graph/local-tx (:graph-uuid r)}])
-            (<! (p->c
-                 (p/do!
-                  (.storeMetadata worker-obj repo (pr-str {:graph/uuid (:graph-uuid r)})))))
-            (op-mem-layer/init-empty-ops-store! repo)
-            (op-mem-layer/update-graph-uuid! repo (:graph-uuid r))
-            (op-mem-layer/update-local-tx! repo (:t r))
-            (<! (op-mem-layer/<sync-to-idb-layer! repo))
-            r))))))
-
 (defn <async-upload-graph
   [state repo conn remote-graph-name]
   (go