From efadf59f13ab8aee9307182ec19bf0baafd66094 Mon Sep 17 00:00:00 2001 From: Ming Di Leom Date: Sun, 6 Mar 2022 05:50:29 +0000 Subject: [PATCH] refactor(cache_control): replace fs.rmdir() with fs.rm() - to be deprecated https://nodejs.org/api/deprecations.html#DEP0147 --- src/cache_control.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cache_control.js b/src/cache_control.js index a3ed1da..5732e63 100644 --- a/src/cache_control.js +++ b/src/cache_control.js @@ -5,7 +5,7 @@ module.exports.removeCacheFiles = function() { const fs = require('fs'); const wiki_files = './media/wikipedia/'; - fs.rmdir(wiki_files, { recursive: true, force: true }, () => { + fs.rm(wiki_files, { recursive: true, force: true }, () => { console.log('Cleared cached static media files. You can turn this off by setting the config.cache_control to false.'); }); }