Skip to content

Commit

Permalink
web/satellite: use force delete bucket
Browse files Browse the repository at this point in the history
This change modifies delete bucket requests to optin for force delete
using the x-minio-force-delete header. This solves an issue where
buckets deletes will be slow for buckets that have many objects. This
change is to make the UI emulate uplink rb --force since it has better
performance.

Issue: storj/customer-issues#930

Change-Id: I0a74c1a201e74b07eb30b917adf78ef865ce2003
  • Loading branch information
wilfred-asomanii authored and Storj Robot committed Aug 9, 2023
1 parent 7d149dc commit 6b2fb9d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions web/satellite/src/store/modules/bucketsStore.ts
Expand Up @@ -98,6 +98,14 @@ export const useBucketsStore = defineStore('buckets', () => {
};

state.s3ClientForDelete = new S3Client(s3Config);

state.s3ClientForDelete.middlewareStack.add(
(next, _) => (args) => {
(args.request as { headers: {key:string} }).headers['x-minio-force-delete'] = 'true';
return next(args);
},
{ step: 'build' },
);
}

function setEdgeCredentialsForCreate(credentials: EdgeCredentials): void {
Expand Down

0 comments on commit 6b2fb9d

Please sign in to comment.