Merge branch 'feature/optimize-history'

This commit is contained in:
plegall
2016-11-25 18:38:56 +01:00
6 changed files with 411 additions and 166 deletions
+13
View File
@@ -495,6 +495,19 @@ INSERT INTO '.HISTORY_TABLE.'
;';
pwg_query($query);
$history_id = pwg_db_insert_id(HISTORY_TABLE);
if ($history_id % 1000 == 0)
{
include_once(PHPWG_ROOT_PATH.'admin/include/functions_history.inc.php');
history_summarize(50000);
}
if ($conf['history_autopurge_every'] > 0 and $history_id % $conf['history_autopurge_every'] == 0)
{
include_once(PHPWG_ROOT_PATH.'admin/include/functions_history.inc.php');
history_autopurge();
}
return true;
}