diff options
author | Chocobozzz <me@florianbigard.com> | 2022-06-30 09:25:17 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-06-30 09:25:17 +0200 |
commit | cd25344f741e8c97b113b36eb6babc7be490114d (patch) | |
tree | 83742ef011ea3ea66cba7fefbafa593614215e22 /server/lib/files-cache/videos-caption-cache.ts | |
parent | a4152bed14427ef91f69e11d1a2cd9745aa74408 (diff) | |
download | PeerTube-cd25344f741e8c97b113b36eb6babc7be490114d.tar.gz PeerTube-cd25344f741e8c97b113b36eb6babc7be490114d.tar.zst PeerTube-cd25344f741e8c97b113b36eb6babc7be490114d.zip |
Reduce lazy static error logs
Diffstat (limited to 'server/lib/files-cache/videos-caption-cache.ts')
-rw-r--r-- | server/lib/files-cache/videos-caption-cache.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/server/lib/files-cache/videos-caption-cache.ts b/server/lib/files-cache/videos-caption-cache.ts index 2927c37eb..d21acf4ef 100644 --- a/server/lib/files-cache/videos-caption-cache.ts +++ b/server/lib/files-cache/videos-caption-cache.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { join } from 'path' | 1 | import { join } from 'path' |
2 | import { logger } from '@server/helpers/logger' | ||
2 | import { doRequestAndSaveToFile } from '@server/helpers/requests' | 3 | import { doRequestAndSaveToFile } from '@server/helpers/requests' |
3 | import { CONFIG } from '../../initializers/config' | 4 | import { CONFIG } from '../../initializers/config' |
4 | import { FILES_CACHE } from '../../initializers/constants' | 5 | import { FILES_CACHE } from '../../initializers/constants' |
@@ -41,9 +42,15 @@ class VideosCaptionCache extends AbstractVideoStaticFileCache <string> { | |||
41 | const remoteUrl = videoCaption.getFileUrl(video) | 42 | const remoteUrl = videoCaption.getFileUrl(video) |
42 | const destPath = join(FILES_CACHE.VIDEO_CAPTIONS.DIRECTORY, videoCaption.filename) | 43 | const destPath = join(FILES_CACHE.VIDEO_CAPTIONS.DIRECTORY, videoCaption.filename) |
43 | 44 | ||
44 | await doRequestAndSaveToFile(remoteUrl, destPath) | 45 | try { |
46 | await doRequestAndSaveToFile(remoteUrl, destPath) | ||
45 | 47 | ||
46 | return { isOwned: false, path: destPath } | 48 | return { isOwned: false, path: destPath } |
49 | } catch (err) { | ||
50 | logger.info('Cannot fetch remote caption file %s.', remoteUrl, { err }) | ||
51 | |||
52 | return undefined | ||
53 | } | ||
47 | } | 54 | } |
48 | } | 55 | } |
49 | 56 | ||