diff options
Diffstat (limited to 'server/lib/cache')
-rw-r--r-- | server/lib/cache/abstract-video-static-file-cache.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/lib/cache/abstract-video-static-file-cache.ts b/server/lib/cache/abstract-video-static-file-cache.ts index 3e20c5d2a..7512f2b9d 100644 --- a/server/lib/cache/abstract-video-static-file-cache.ts +++ b/server/lib/cache/abstract-video-static-file-cache.ts | |||
@@ -1,6 +1,5 @@ | |||
1 | import * as AsyncLRU from 'async-lru' | 1 | import * as AsyncLRU from 'async-lru' |
2 | import { createWriteStream } from 'fs-extra' | 2 | import { createWriteStream, remove } from 'fs-extra' |
3 | import { unlinkPromise } from '../../helpers/core-utils' | ||
4 | import { logger } from '../../helpers/logger' | 3 | import { logger } from '../../helpers/logger' |
5 | import { VideoModel } from '../../models/video/video' | 4 | import { VideoModel } from '../../models/video/video' |
6 | import { fetchRemoteVideoStaticFile } from '../activitypub' | 5 | import { fetchRemoteVideoStaticFile } from '../activitypub' |
@@ -26,7 +25,7 @@ export abstract class AbstractVideoStaticFileCache <T> { | |||
26 | }) | 25 | }) |
27 | 26 | ||
28 | this.lru.on('evict', (obj: { key: string, value: string }) => { | 27 | this.lru.on('evict', (obj: { key: string, value: string }) => { |
29 | unlinkPromise(obj.value) | 28 | remove(obj.value) |
30 | .then(() => logger.debug('%s evicted from %s', obj.value, this.constructor.name)) | 29 | .then(() => logger.debug('%s evicted from %s', obj.value, this.constructor.name)) |
31 | }) | 30 | }) |
32 | } | 31 | } |