From ee7ef89dfbd9d5e3f1e5a0f3b1a7d50bf92b5f26 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 9 Apr 2019 01:31:48 +0900 Subject: [PATCH] Fix bug --- src/models/entities/drive-file.ts | 4 ++-- src/services/drive/delete-file.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/models/entities/drive-file.ts b/src/models/entities/drive-file.ts index a8f8c69e5..21db4bd71 100644 --- a/src/models/entities/drive-file.ts +++ b/src/models/entities/drive-file.ts @@ -95,9 +95,9 @@ export class DriveFile { @Index({ unique: true }) @Column('varchar', { - length: 256, + length: 256, nullable: true, }) - public accessKey: string; + public accessKey: string | null; @Index({ unique: true }) @Column('varchar', { diff --git a/src/services/drive/delete-file.ts b/src/services/drive/delete-file.ts index adf57416f..9c23b39bf 100644 --- a/src/services/drive/delete-file.ts +++ b/src/services/drive/delete-file.ts @@ -16,7 +16,7 @@ export default async function(file: DriveFile, isExpired = false) { if (file.webpublicUrl) { InternalStorage.del(file.webpublicAccessKey); } - } else { + } else if (!file.isRemote) { const minio = new Minio.Client(config.drive.config); await minio.removeObject(config.drive.bucket, file.accessKey);