Skip to content

Commit

Permalink
fix(flat-server-api): batch delete cloud storage files (#1753)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious authored Oct 27, 2022
1 parent 534ba7f commit b0cd6dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/flat-server-api/src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ export interface RemoveFilesPayload {

export async function removeFiles(payload: RemoveFilesPayload): Promise<void> {
if (payload.uuids.length > 0) {
await postV2("cloud-storage/delete", payload);
for (let i = 0; i < payload.uuids.length; i += 50) {
const slice = payload.uuids.slice(i, i + 50);
await postV2("cloud-storage/delete", { uuids: slice });
}
}
}

Expand Down

0 comments on commit b0cd6dd

Please sign in to comment.