Stop updating lastupdate when posting. Cleanup more logging for memcache.

This commit is contained in:
Retro_Guy 2024-05-10 05:02:45 -07:00
parent c5e72c94a8
commit 571e5eaabd
1 changed files with 13 additions and 14 deletions

View File

@ -640,8 +640,8 @@ function groups_show($gruppen)
if ($lastarticleinfo && file_exists($groupfile) && filemtime($groupfile) <= $lastarticleinfo['date']) {
if ($enable_memcache_logging) {
file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . ' Found lastarticleinfo for ' . $g->name . ' in memcache', FILE_APPEND);
$found = 1;
}
$found = 1;
} else {
unset($lastarticleinfo);
}
@ -657,7 +657,7 @@ function groups_show($gruppen)
]);
$found = 0;
while ($row = $overview_query->fetch()) {
if($row['date'] > time()) {
if ($row['date'] > time()) {
continue;
}
$found = 1;
@ -671,10 +671,12 @@ function groups_show($gruppen)
touch($groupfile, $lastarticleinfo['date']);
$nicole = $memcacheD->delete($lar_memcache);
$memcacheD->add($lar_memcache, serialize($row), $memcache_ttl);
if ($nicole) {
file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Updated $lar_memcache in memcache", FILE_APPEND);
} else {
file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Wrote $lar_memcache to memcache", FILE_APPEND);
if ($enable_memcache_logging) {
if ($nicole) {
file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Updated $lar_memcache in memcache", FILE_APPEND);
} else {
file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Wrote $lar_memcache to memcache", FILE_APPEND);
}
}
}
}
@ -2344,12 +2346,12 @@ function insert_article_from_array($this_article, $check_duplicates = true)
}
}
if($this_article['epochdate'] > time()) {
if ($this_article['epochdate'] > time()) {
echo "\n(newsportal)Article date in future. Skipping: " . $group . ":" . $this_article['mid'];
file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " Article date in future. Skipping: " . $group . ":" . $this_article['mid'], FILE_APPEND);
return "441 Insert failed (article date in future)\r\n";
}
// Open articles Database
if ($CONFIG['article_database'] == '1') {
$article_dbh = article_db_open($spooldir . '/' . $group . '-articles.db3');
@ -2412,11 +2414,6 @@ function insert_article_from_array($this_article, $check_duplicates = true)
$statusdate = time();
$statusreason = "imported";
add_to_history($group, $this_article['local'], $this_article['mid'], $status, $statusdate, $statusreason, $statusnotes);
if ($this_article['epochdate'] < time()) {
touch($spooldir . '/' . $group . '-lastupdate.dat', $this_article['epochdate']);
} else {
touch($spooldir . '/' . $group . '-lastupdate.dat', time());
}
}
function is_deleted_post($group, $number)
@ -2528,7 +2525,9 @@ function get_data_from_msgid($msgid, $thisgroup = null)
if ($memcacheD) {
$row_cache = 'get_data_from_msgid-' . $msgid;
if ($row = $memcacheD->get($row_cache)) {
file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Found $row_cache in memcache", FILE_APPEND);
if ($enable_memcache_logging) {
file_put_contents($logdir . '/memcache.log', "\n" . format_log_date() . " Found $row_cache in memcache", FILE_APPEND);
}
return $row;
}
}