优化缓存清除

master
宇天 2020-09-28 09:49:20 +08:00
parent cb26c1b2f7
commit d4f0918ca3
3 changed files with 7 additions and 3 deletions

View File

@ -29,7 +29,9 @@ class Smarty {
this.reset()
this.__CACHE__ = Object.create(null) // 渲染缓存
// 消除缓存目录
fs.rm(cacheDir)
if (fs.isdir(cacheDir)) {
fs.rm(cacheDir)
}
}
reset() {

View File

@ -31,7 +31,9 @@ export default class Smarty {
this.reset()
this.__CACHE__ = Object.create(null) // 渲染缓存
// 消除缓存目录
fs.rm(cacheDir)
if (fs.isdir(cacheDir)) {
fs.rm(cacheDir)
}
}
reset() {

View File

@ -1,6 +1,6 @@
{
"name": "smartyx",
"version": "2.1.0",
"version": "2.1.1",
"description": "nodeJS模板引擎理念源自于PHP的smarty模板引擎",
"keywords": ["fivejs", "php", "smarty", "template", "ejs", "jade"],
"author": "yutent <yutent.io@gmail.com>",