mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-22 05:55:12 +00:00
ensure that "thumbnail stored" / "web stored" messages only appear after success
This commit is contained in:
parent
7aee3c1617
commit
fcd2c93a19
1 changed files with 8 additions and 2 deletions
|
@ -234,16 +234,22 @@ export class DriveService {
|
||||||
|
|
||||||
if (alts.thumbnail) {
|
if (alts.thumbnail) {
|
||||||
promises.push(this.internalStorageService.saveFromBuffer(thumbnailAccessKey, alts.thumbnail.data));
|
promises.push(this.internalStorageService.saveFromBuffer(thumbnailAccessKey, alts.thumbnail.data));
|
||||||
this.registerLogger.info(`thumbnail stored: ${thumbnailAccessKey}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alts.webpublic) {
|
if (alts.webpublic) {
|
||||||
promises.push(this.internalStorageService.saveFromBuffer(webpublicAccessKey, alts.webpublic.data));
|
promises.push(this.internalStorageService.saveFromBuffer(webpublicAccessKey, alts.webpublic.data));
|
||||||
this.registerLogger.info(`web stored: ${webpublicAccessKey}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [url, thumbnailUrl, webpublicUrl] = await Promise.all(promises);
|
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.storedInternal = true;
|
||||||
file.url = url;
|
file.url = url;
|
||||||
file.thumbnailUrl = thumbnailUrl ?? null;
|
file.thumbnailUrl = thumbnailUrl ?? null;
|
||||||
|
|
Loading…
Reference in a new issue