Apply in overboard flat view.

This commit is contained in:
Retro_Guy 2024-05-12 04:10:54 -07:00
parent f7fbe1307c
commit 7189381f46
3 changed files with 38 additions and 5 deletions

View File

@ -2471,9 +2471,25 @@ function clear_history_by_group($group)
$history_dbh = null; $history_dbh = null;
} }
/* get_data_from_msgid uses overview database */
/* get_db_data_from_msgid uses overview database */
function get_db_data_from_msgid($msgid, $group) function get_db_data_from_msgid($msgid, $group)
{ {
global $spooldir; global $spooldir, $config_dir, $logdir;
if (file_exists($config_dir . '/memcache.inc.php')) {
include $config_dir . '/memcache.inc.php';
}
if ($memcacheD) {
$row_cache = 'get_db_data_from_msgid-' . $msgid;
if ($row = $memcacheD->get($row_cache)) {
if ($enable_memcache_logging) {
file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " (cache hit) $row_cache", FILE_APPEND);
}
return $row;
}
}
$database = $spooldir . '/' . $group . '-articles.db3'; $database = $spooldir . '/' . $group . '-articles.db3';
if (! is_file($database)) { if (! is_file($database)) {
return false; return false;
@ -2490,6 +2506,12 @@ function get_db_data_from_msgid($msgid, $group)
} }
$dbh = null; $dbh = null;
if ($found) { if ($found) {
if ($memcacheD) {
$nicole = $memcacheD->add($row_cache, $row, $memcache_ttl);
if ($enable_memcache_logging && $nicole) {
file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Wrote $row_cache", FILE_APPEND);
}
}
return $row; return $row;
} else { } else {
return false; return false;
@ -2519,13 +2541,19 @@ function get_group_array_from_msgid($msgid)
} }
} }
/* get_data_from_msgid uses overview database */
/* get_db_data_from_msgid uses overview database */
function get_data_from_msgid($msgid, $thisgroup = null) function get_data_from_msgid($msgid, $thisgroup = null)
{ {
global $spooldir, $config_dir, $logdir; global $spooldir, $config_dir, $logdir, $CONFIG;
if (file_exists($config_dir . '/memcache.inc.php')) { if (file_exists($config_dir . '/memcache.inc.php')) {
include $config_dir . '/memcache.inc.php'; include $config_dir . '/memcache.inc.php';
} }
if ($CONFIG['article_database'] == '1' && isset($thisgroup)) {
return get_db_data_from_msgid($msgid, $thisgroup);
}
if ($memcacheD) { if ($memcacheD) {
$row_cache = 'get_data_from_msgid-' . $msgid; $row_cache = 'get_data_from_msgid-' . $msgid;
if ($row = $memcacheD->get($row_cache)) { if ($row = $memcacheD->get($row_cache)) {
@ -2558,7 +2586,10 @@ function get_data_from_msgid($msgid, $thisgroup = null)
$dbh = null; $dbh = null;
if ($found) { if ($found) {
if ($memcacheD) { if ($memcacheD) {
$memcacheD->add($row_cache, $row, $memcache_ttl); $nicole = $memcacheD->add($row_cache, $row, $memcache_ttl);
if ($enable_memcache_logging && $nicole) {
file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Wrote $row_cache", FILE_APPEND);
}
} }
return $row; return $row;
} else { } else {

View File

@ -537,6 +537,9 @@ function display_flat($threads, $oldest)
} }
} }
$results ++; $results ++;
if($results > $maxdisplay) {
break;
}
} }
$display .= "</table>"; $display .= "</table>";
echo $display; echo $display;

View File

@ -16,8 +16,6 @@ $memcache_ttl = 14400;
/* PLEASE DO NOT EDIT BELOW THIS LINE */ /* PLEASE DO NOT EDIT BELOW THIS LINE */
/* PLEASE DO NOT EDIT BELOW THIS LINE */
if ($enable_memcache) { if ($enable_memcache) {
$memcacheD = new Memcached('memcacheD'); $memcacheD = new Memcached('memcacheD');
$memcacheD->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true); $memcacheD->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
@ -37,3 +35,4 @@ if ($enable_memcache) {
} }
} }
} }