aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/cache
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-27 16:23:34 +0200
committerChocobozzz <me@florianbigard.com>2018-08-27 16:23:34 +0200
commit62689b942b71cd1dd0d050c6ed05f884a0b325c2 (patch)
treec45c35d35d7a3e32621fba06edc63646930c8efd /server/lib/cache
parent84b6dbcc6e8654f39ec798905e1151ba915cd1aa (diff)
downloadPeerTube-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.ts5
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 @@
1import * as AsyncLRU from 'async-lru' 1import * as AsyncLRU from 'async-lru'
2import { createWriteStream } from 'fs-extra' 2import { createWriteStream, remove } from 'fs-extra'
3import { unlinkPromise } from '../../helpers/core-utils'
4import { logger } from '../../helpers/logger' 3import { logger } from '../../helpers/logger'
5import { VideoModel } from '../../models/video/video' 4import { VideoModel } from '../../models/video/video'
6import { fetchRemoteVideoStaticFile } from '../activitypub' 5import { 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 }