]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/cache/abstract-video-static-file-cache.ts
Add Introduction to README
[github/Chocobozzz/PeerTube.git] / server / lib / cache / abstract-video-static-file-cache.ts
index 3e20c5d2adbf5b8852ff1a0f07e73676b260666e..7512f2b9da0b260feff00afad908601003fcf25a 100644 (file)
@@ -1,6 +1,5 @@
 import * as AsyncLRU from 'async-lru'
-import { createWriteStream } from 'fs-extra'
-import { unlinkPromise } from '../../helpers/core-utils'
+import { createWriteStream, remove } from 'fs-extra'
 import { logger } from '../../helpers/logger'
 import { VideoModel } from '../../models/video/video'
 import { fetchRemoteVideoStaticFile } from '../activitypub'
@@ -26,7 +25,7 @@ export abstract class AbstractVideoStaticFileCache <T> {
     })
 
     this.lru.on('evict', (obj: { key: string, value: string }) => {
-      unlinkPromise(obj.value)
+      remove(obj.value)
         .then(() => logger.debug('%s evicted from %s', obj.value, this.constructor.name))
     })
   }