优化缓存清除

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,8 +29,10 @@ class Smarty {
this.reset() this.reset()
this.__CACHE__ = Object.create(null) // 渲染缓存 this.__CACHE__ = Object.create(null) // 渲染缓存
// 消除缓存目录 // 消除缓存目录
if (fs.isdir(cacheDir)) {
fs.rm(cacheDir) fs.rm(cacheDir)
} }
}
reset() { reset() {
this.__DATA__ = Object.create(null) // 预定义的变量储存 this.__DATA__ = Object.create(null) // 预定义的变量储存

View File

@ -31,8 +31,10 @@ export default class Smarty {
this.reset() this.reset()
this.__CACHE__ = Object.create(null) // 渲染缓存 this.__CACHE__ = Object.create(null) // 渲染缓存
// 消除缓存目录 // 消除缓存目录
if (fs.isdir(cacheDir)) {
fs.rm(cacheDir) fs.rm(cacheDir)
} }
}
reset() { reset() {
this.__DATA__ = Object.create(null) // 预定义的变量储存 this.__DATA__ = Object.create(null) // 预定义的变量储存

View File

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