This commit is contained in:
syuilo 2019-04-09 01:31:48 +09:00
parent 54a5246061
commit ee7ef89dfb
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
2 changed files with 3 additions and 3 deletions

View file

@ -95,9 +95,9 @@ export class DriveFile {
@Index({ unique: true }) @Index({ unique: true })
@Column('varchar', { @Column('varchar', {
length: 256, length: 256, nullable: true,
}) })
public accessKey: string; public accessKey: string | null;
@Index({ unique: true }) @Index({ unique: true })
@Column('varchar', { @Column('varchar', {

View file

@ -16,7 +16,7 @@ export default async function(file: DriveFile, isExpired = false) {
if (file.webpublicUrl) { if (file.webpublicUrl) {
InternalStorage.del(file.webpublicAccessKey); InternalStorage.del(file.webpublicAccessKey);
} }
} else { } else if (!file.isRemote) {
const minio = new Minio.Client(config.drive.config); const minio = new Minio.Client(config.drive.config);
await minio.removeObject(config.drive.bucket, file.accessKey); await minio.removeObject(config.drive.bucket, file.accessKey);