refactor(cache_control): replace fs.rmdir() with fs.rm()

-  to be deprecated https://nodejs.org/api/deprecations.html#DEP0147
This commit is contained in:
Ming Di Leom
2022-03-06 05:50:29 +00:00
parent 43d88ac455
commit efadf59f13
+1 -1
View File
@@ -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.');
});
}