feat: utilities - cache
This commit is contained in:
@@ -164,4 +164,8 @@ module.exports = class Asset extends Model {
|
||||
res.sendStatus(404)
|
||||
}
|
||||
}
|
||||
|
||||
static async flushTempUploads() {
|
||||
return fs.emptyDir(path.join(process.cwd(), `data/uploads`))
|
||||
}
|
||||
}
|
||||
|
@@ -417,6 +417,10 @@ module.exports = class Page extends Model {
|
||||
return fs.remove(path.join(process.cwd(), `data/cache/${page.hash}.bin`))
|
||||
}
|
||||
|
||||
static async flushCache() {
|
||||
return fs.emptyDir(path.join(process.cwd(), `data/cache`))
|
||||
}
|
||||
|
||||
static cleanHTML(rawHTML = '') {
|
||||
return striptags(rawHTML || '')
|
||||
.replace(emojiRegex(), '')
|
||||
|
Reference in New Issue
Block a user