enhance(sync): partition files for <delete-remote-files-control

pull/7472/head
rcmerci 2022-11-25 16:42:13 +08:00 committed by Tienson Qin
parent 91d70535ee
commit 410381c820
1 changed files with 6 additions and 3 deletions

View File

@ -1360,9 +1360,12 @@
IRemoteControlAPI IRemoteControlAPI
(<delete-remote-files-control [this graph-uuid filepaths] (<delete-remote-files-control [this graph-uuid filepaths]
(user/<wrap-ensure-id&access-token (user/<wrap-ensure-id&access-token
(let [current-txid (:TXId (<! (<get-remote-graph this nil graph-uuid))) (let [partitioned-files (partition-all 20 (<! (<encrypt-fnames rsapi graph-uuid filepaths)))]
files (<! (<encrypt-fnames rsapi graph-uuid filepaths))] (loop [[files & others] partitioned-files]
(<! (.<request this "delete_files" {:GraphUUID graph-uuid :TXId current-txid :Files files})))))) (when files
(let [current-txid (:TXId (<! (<get-remote-graph this nil graph-uuid)))]
(<! (.<request this "delete_files" {:GraphUUID graph-uuid :TXId current-txid :Files files}))
(recur others))))))))
(comment (comment
(declare remoteapi) (declare remoteapi)