web/satellite: use force delete bucket

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: https://github.com/storj/customer-issues/issues/930

Change-Id: I0a74c1a201e74b07eb30b917adf78ef865ce2003
This commit is contained in:
Wilfred Asomani 2023-08-04 17:08:50 +00:00 committed by Storj Robot
parent 7d149dca0f
commit 6b2fb9dfc4

View File

@ -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 {