fix: <! can't be used without go

pull/7516/head
Tienson Qin 2022-11-30 00:34:48 +08:00
parent 4167c7b5cb
commit 9b41de8ad9
1 changed files with 6 additions and 6 deletions

View File

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