diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-27 16:23:34 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-27 16:23:34 +0200 |
commit | 62689b942b71cd1dd0d050c6ed05f884a0b325c2 (patch) | |
tree | c45c35d35d7a3e32621fba06edc63646930c8efd /server/lib/cache | |
parent | 84b6dbcc6e8654f39ec798905e1151ba915cd1aa (diff) | |
download | PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.tar.gz PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.tar.zst PeerTube-62689b942b71cd1dd0d050c6ed05f884a0b325c2.zip |
Correctly migrate to fs-extra
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 | } |