Revert "fix: <! can't be used without go"

This reverts commit 9b41de8ad9.
This commit is contained in:
rcmerci
2022-11-30 11:31:46 +08:00
committed by Tienson Qin
parent 166f2b2432
commit 279dbf7de3

View File

@@ -779,7 +779,7 @@
(declare <rsapi-cancel-all-requests)
(defn- build-local-file-metadatas
[this graph-uuid result read-chan!]
[this graph-uuid result]
(loop [[[path metadata] & others] (js->clj result)
result #{}]
(if-not (and path metadata)
@@ -787,7 +787,7 @@
result
(let [normalized-path (path-normalize path)
encryptedFname (if (not= path normalized-path)
(first (read-chan! (<encrypt-fnames this graph-uuid [normalized-path])))
(first (<! (<encrypt-fnames this graph-uuid [normalized-path])))
(get metadata "encryptedFname"))]
(recur others
(conj result
@@ -816,12 +816,12 @@
(let [r (<! (<retry-rsapi #(p->c (ipc/ipc "get-local-all-files-meta" graph-uuid base-path))))]
(if (instance? ExceptionInfo r)
r
(build-local-file-metadatas this graph-uuid r <!)))))
(build-local-file-metadatas this graph-uuid r)))))
(<get-local-files-meta [this graph-uuid base-path filepaths]
(go
(let [r (<! (<retry-rsapi #(p->c (ipc/ipc "get-local-files-meta" graph-uuid base-path filepaths))))]
(assert (not (instance? ExceptionInfo r)) "get-local-files-meta shouldn't return exception")
(build-local-file-metadatas this graph-uuid r <!))))
(build-local-file-metadatas this graph-uuid r))))
(<rename-local-file [_ graph-uuid base-path from to]
(<retry-rsapi #(p->c (ipc/ipc "rename-local-file" graph-uuid base-path
(path-normalize from)
@@ -900,7 +900,7 @@
:basePath base-path}))))]
(if (instance? ExceptionInfo r)
r
(build-local-file-metadatas this graph-uuid (.-result r) <!)))))
(build-local-file-metadatas this graph-uuid (.-result r))))))
(<get-local-files-meta [this graph-uuid base-path filepaths]
(go
@@ -909,7 +909,7 @@
:basePath base-path
:filePaths filepaths}))))]
(assert (not (instance? ExceptionInfo r)) "get-local-files-meta shouldn't return exception")
(build-local-file-metadatas this graph-uuid (.-result r) <!))))
(build-local-file-metadatas this graph-uuid (.-result r)))))
(<rename-local-file [_ graph-uuid base-path from to]
(p->c (.renameLocalFile mobile-util/file-sync