mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-03 16:32:22 +02:00
Merge branch 'feature/optimize-history'
This commit is contained in:
@@ -553,6 +553,16 @@ $conf['guest_access'] = true;
|
||||
// nb_logs_page : how many logs to display on a page
|
||||
$conf['nb_logs_page'] = 300;
|
||||
|
||||
// Every X new line in history, perform an automatic purge. The more often,
|
||||
// the fewer lines to delete. 0 to disable.
|
||||
$conf['history_autopurge_every'] = 1021;
|
||||
|
||||
// How many lines to keep in history on autopurge? 0 to disable.
|
||||
$conf['history_autopurge_keep_lines'] = 1000000;
|
||||
|
||||
// On history autopurge, how many lines should to deleted at once, maximum?
|
||||
$conf['history_autopurge_blocksize'] = 50000;
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | urls |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user