diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-09 15:04:36 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-09 15:04:36 +0200 |
commit | e2600d8b261994abbbeb1ff921edaefd267fc122 (patch) | |
tree | fb19495cb4ba502324a2318c83cd4936b956fc1c /server/controllers | |
parent | 5bb2eb5660c87700bc70fe82219c1a84e7c7b177 (diff) | |
download | PeerTube-e2600d8b261994abbbeb1ff921edaefd267fc122.tar.gz PeerTube-e2600d8b261994abbbeb1ff921edaefd267fc122.tar.zst PeerTube-e2600d8b261994abbbeb1ff921edaefd267fc122.zip |
Add avatar to prune script
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/lazy-static.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/controllers/lazy-static.ts b/server/controllers/lazy-static.ts index 4285fd727..28d2f862a 100644 --- a/server/controllers/lazy-static.ts +++ b/server/controllers/lazy-static.ts | |||
@@ -49,7 +49,12 @@ async function getAvatar (req: express.Request, res: express.Response) { | |||
49 | 49 | ||
50 | logger.info('Lazy serve remote avatar image %s.', avatar.fileUrl) | 50 | logger.info('Lazy serve remote avatar image %s.', avatar.fileUrl) |
51 | 51 | ||
52 | await pushAvatarProcessInQueue({ filename: avatar.filename, fileUrl: avatar.fileUrl }) | 52 | try { |
53 | await pushAvatarProcessInQueue({ filename: avatar.filename, fileUrl: avatar.fileUrl }) | ||
54 | } catch (err) { | ||
55 | logger.warn('Cannot process remote avatar %s.', avatar.fileUrl, { err }) | ||
56 | return res.sendStatus(404) | ||
57 | } | ||
53 | 58 | ||
54 | avatar.onDisk = true | 59 | avatar.onDisk = true |
55 | avatar.save() | 60 | avatar.save() |