upd flip check
This commit is contained in:
@@ -407,7 +407,9 @@ export class DriveService {
|
|||||||
);
|
);
|
||||||
if (this.meta.objectStorageSetPublicRead) params.ACL = 'public-read';
|
if (this.meta.objectStorageSetPublicRead) params.ACL = 'public-read';
|
||||||
|
|
||||||
if (!this.meta.objectStorageEndpoint?.includes('bunnycdn.com')) {
|
if (this.meta.objectStorageEndpoint && this.meta.objectStorageEndpoint.includes('bunnycdn.com')) {
|
||||||
|
await this.bunnyService.upload(this.meta, key, stream);
|
||||||
|
} else {
|
||||||
await this.s3Service.upload(this.meta, params)
|
await this.s3Service.upload(this.meta, params)
|
||||||
.then(
|
.then(
|
||||||
result => {
|
result => {
|
||||||
@@ -422,8 +424,6 @@ export class DriveService {
|
|||||||
this.registerLogger.error(`Upload Failed: key = ${key}, filename = ${filename}`, err);
|
this.registerLogger.error(`Upload Failed: key = ${key}, filename = ${filename}`, err);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
await this.bunnyService.upload(this.meta, key, stream);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -820,10 +820,10 @@ export class DriveService {
|
|||||||
Bucket: this.meta.objectStorageBucket,
|
Bucket: this.meta.objectStorageBucket,
|
||||||
Key: key,
|
Key: key,
|
||||||
} as DeleteObjectCommandInput;
|
} as DeleteObjectCommandInput;
|
||||||
if (!this.meta.objectStorageEndpoint?.includes('bunnycdn.com')) {
|
if (this.meta.objectStorageEndpoint && this.meta.objectStorageEndpoint.includes('bunnycdn.com')) {
|
||||||
await this.s3Service.delete(this.meta, param);
|
|
||||||
} else {
|
|
||||||
await this.bunnyService.delete(this.meta, key);
|
await this.bunnyService.delete(this.meta, key);
|
||||||
|
} else {
|
||||||
|
await this.s3Service.delete(this.meta, param);
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err.name === 'NoSuchKey') {
|
if (err.name === 'NoSuchKey') {
|
||||||
|
|||||||
Reference in New Issue
Block a user