fixed: as we have insert_page ezc function now

we cannot delete ezc patterns when PatternCacher::GetPattern() method is called
       because we can delete a pattern which is in use
       now deleting is performed at the end of a request


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@751 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2011-07-15 02:09:02 +00:00
parent 1812a2e9ad
commit c37c1ff812
9 changed files with 108 additions and 54 deletions

View File

@@ -674,6 +674,17 @@ size_t loc, pat;
}
void Templates::Init()
{
using namespace TemplatesFunctions;
pattern_cacher.SetWhenDelete(config->pattern_cacher_when_delete, config->pattern_cacher_how_many_delete);
CreateFunctions(); // create functions first (functions will be cached by patterns)
ReadIndexFileNames();
ReadTemplates();
}
// index_patterns and patterns for items are not cleared here
void Templates::ClearPatterns()
{
@@ -684,6 +695,16 @@ using namespace TemplatesFunctions;
}
// clearing at the end of a request
void Templates::RequestEnd()
{
using namespace TemplatesFunctions;
log << log4 << "Templates: patterns cache size: " << pattern_cacher.Size() << logend;
pattern_cacher.DeleteOldPatterns();
}
void Templates::Generate()
{
using namespace TemplatesFunctions;