Abort when MinIO bucket does not have versioning enabled #545 (#546)

Co-authored-by: Florent FAYOLLE <florent.fayolle@beta.gouv.fr>
This commit is contained in:
Florent
2023-07-10 12:24:55 +02:00
committed by GitHub
parent a56b0448ff
commit b6b2d05be0
7 changed files with 69 additions and 39 deletions

View File

@@ -50,6 +50,7 @@ export interface ICreateActiveDocOptions {
export interface ICreateStorageOptions {
name: string;
check(): boolean;
checkBackend?(): Promise<void>;
create(purpose: 'doc'|'meta', extraPrefix: string): ExternalStorage|undefined;
}
@@ -119,7 +120,10 @@ export function makeSimpleCreator(opts: {
},
async configure() {
for (const s of storage || []) {
if (s.check()) { break; }
if (s.check()) {
await s.checkBackend?.();
break;
}
}
},
...(opts.shell && {