From 505319061e28da647c2e9af6e65721d6b8f9da1b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 8 Oct 2018 10:37:08 +0200 Subject: Fix avatar update --- server/models/avatar/avatar.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server/models') diff --git a/server/models/avatar/avatar.ts b/server/models/avatar/avatar.ts index 5d73e24fa..303aebcc2 100644 --- a/server/models/avatar/avatar.ts +++ b/server/models/avatar/avatar.ts @@ -23,7 +23,10 @@ export class AvatarModel extends Model { @AfterDestroy static removeFilesAndSendDelete (instance: AvatarModel) { logger.info('Removing avatar file %s.', instance.filename) - return instance.removeAvatar() + + // Don't block the transaction + instance.removeAvatar() + .catch(err => logger.error('Cannot remove avatar file %s.', instance.filename, err)) } toFormattedJSON (): Avatar { -- cgit v1.2.3