summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/DriveService.ts
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2024-10-20 00:13:07 -0400
committerHazelnoot <acomputerdog@gmail.com>2024-10-20 00:13:07 -0400
commitfcd2c93a19b6bad823d8543ab4ebc4da613b063e (patch)
tree5e0783cc16bb51931519862c4410a0e23fd03a3b /packages/backend/src/core/DriveService.ts
parentfix comment typo in InternalStorageService.ts (diff)
downloadsharkey-fcd2c93a19b6bad823d8543ab4ebc4da613b063e.tar.gz
sharkey-fcd2c93a19b6bad823d8543ab4ebc4da613b063e.tar.bz2
sharkey-fcd2c93a19b6bad823d8543ab4ebc4da613b063e.zip
ensure that "thumbnail stored" / "web stored" messages only appear after success
Diffstat (limited to 'packages/backend/src/core/DriveService.ts')
-rw-r--r--packages/backend/src/core/DriveService.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/backend/src/core/DriveService.ts b/packages/backend/src/core/DriveService.ts
index 781b435c9a..e75928d83e 100644
--- a/packages/backend/src/core/DriveService.ts
+++ b/packages/backend/src/core/DriveService.ts
@@ -234,16 +234,22 @@ export class DriveService {
if (alts.thumbnail) {
promises.push(this.internalStorageService.saveFromBuffer(thumbnailAccessKey, alts.thumbnail.data));
- this.registerLogger.info(`thumbnail stored: ${thumbnailAccessKey}`);
}
if (alts.webpublic) {
promises.push(this.internalStorageService.saveFromBuffer(webpublicAccessKey, alts.webpublic.data));
- this.registerLogger.info(`web stored: ${webpublicAccessKey}`);
}
const [url, thumbnailUrl, webpublicUrl] = await Promise.all(promises);
+ if (thumbnailUrl) {
+ this.registerLogger.info(`thumbnail stored: ${thumbnailAccessKey}`);
+ }
+
+ if (webpublicUrl) {
+ this.registerLogger.info(`web stored: ${webpublicAccessKey}`);
+ }
+
file.storedInternal = true;
file.url = url;
file.thumbnailUrl = thumbnailUrl ?? null;