mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Remove unnecessary triggers at cache recompile
캐시파일 재생성 시점에 불필요한 트리거(현재 설치되어 있지 않은 모듈에서 등록한 트리거)를 일괄 삭제하여 평소 실행 속도를 개선함. 프로파일러 모듈에서 제공하는 것과 유사한 기능임. 단, 모듈 설정이나 애드온 설정은 재설치에 대비하여 그대로 둠.
This commit is contained in:
parent
bc14eecd50
commit
43f4a766c6
2 changed files with 19 additions and 1 deletions
|
|
@ -597,8 +597,18 @@ class module extends ModuleObject
|
|||
function recompileCache()
|
||||
{
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleModel->getModuleList();
|
||||
$module_list = $oModuleModel->getModuleList();
|
||||
$module_names = array_map(function($module_info) {
|
||||
return $module_info->module;
|
||||
}, $module_list);
|
||||
|
||||
$oModuleModel->loadModuleExtends();
|
||||
|
||||
// Delete triggers belonging to modules that don't exist
|
||||
$args = new stdClass;
|
||||
$args->module = $module_names ?: [];
|
||||
executeQuery('module.deleteTriggers', $args);
|
||||
Rhymix\Framework\Cache::delete('triggers');
|
||||
}
|
||||
}
|
||||
/* End of file module.class.php */
|
||||
|
|
|
|||
8
modules/module/queries/deleteTriggers.xml
Normal file
8
modules/module/queries/deleteTriggers.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteTriggers" action="delete">
|
||||
<tables>
|
||||
<table name="module_trigger" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="notin" column="module" var="module" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
Loading…
Add table
Add a link
Reference in a new issue