Simple log entry wording change in expire.php.
This commit is contained in:
parent
17e8a5dd5e
commit
f427947ebb
|
@ -1,10 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include "config.inc.php";
|
include "config.inc.php";
|
||||||
include ("$file_newsportal");
|
include ("$file_newsportal");
|
||||||
|
|
||||||
if (filemtime($spooldir . '/' . $config_name . '-expire-timer') + 86400 > time()) {
|
if (filemtime($spooldir . '/' . $config_name . '-expire-timer') + 86400 > time()) {
|
||||||
exit;
|
exit();
|
||||||
}
|
}
|
||||||
$lockfile = $lockdir . '/' . $config_name . '-spoolnews.lock';
|
$lockfile = $lockdir . '/' . $config_name . '-spoolnews.lock';
|
||||||
$pid = file_get_contents($lockfile);
|
$pid = file_get_contents($lockfile);
|
||||||
|
@ -13,7 +12,7 @@
|
||||||
file_put_contents($lockfile, getmypid()); // create lockfile
|
file_put_contents($lockfile, getmypid()); // create lockfile
|
||||||
} else {
|
} else {
|
||||||
print "expire currently running\n";
|
print "expire currently running\n";
|
||||||
exit;
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$webserver_group = $CONFIG['webserver_user'];
|
$webserver_group = $CONFIG['webserver_user'];
|
||||||
|
@ -49,7 +48,10 @@ file_put_contents($logfile, "\n".format_log_date()." ".$config_name." ".$group."
|
||||||
if (is_file($database)) {
|
if (is_file($database)) {
|
||||||
$articles_dbh = article_db_open($database);
|
$articles_dbh = article_db_open($database);
|
||||||
$articles_query = $articles_dbh->prepare('DELETE FROM articles WHERE newsgroup=:newsgroup AND date<:expireme');
|
$articles_query = $articles_dbh->prepare('DELETE FROM articles WHERE newsgroup=:newsgroup AND date<:expireme');
|
||||||
$articles_query->execute([':newsgroup' => $group, ':expireme' => $expireme]);
|
$articles_query->execute([
|
||||||
|
':newsgroup' => $group,
|
||||||
|
':expireme' => $expireme
|
||||||
|
]);
|
||||||
$articles_dbh = null;
|
$articles_dbh = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +62,10 @@ file_put_contents($logfile, "\n".format_log_date()." ".$config_name." ".$group."
|
||||||
$database = $spooldir . '/articles-overview.db3';
|
$database = $spooldir . '/articles-overview.db3';
|
||||||
$dbh = overview_db_open($database);
|
$dbh = overview_db_open($database);
|
||||||
$query = $dbh->prepare('SELECT * FROM overview WHERE newsgroup=:newsgroup AND date<:expireme');
|
$query = $dbh->prepare('SELECT * FROM overview WHERE newsgroup=:newsgroup AND date<:expireme');
|
||||||
$query->execute([':newsgroup' => $group, ':expireme' => $expireme]);
|
$query->execute([
|
||||||
|
':newsgroup' => $group,
|
||||||
|
':expireme' => $expireme
|
||||||
|
]);
|
||||||
$stmt = $dbh->prepare('DELETE FROM overview WHERE newsgroup=:newsgroup AND date<:expireme');
|
$stmt = $dbh->prepare('DELETE FROM overview WHERE newsgroup=:newsgroup AND date<:expireme');
|
||||||
$grouppath = preg_replace('/\./', '/', $group);
|
$grouppath = preg_replace('/\./', '/', $group);
|
||||||
$status = "deleted";
|
$status = "deleted";
|
||||||
|
@ -75,11 +80,14 @@ file_put_contents($logfile, "\n".format_log_date()." ".$config_name." ".$group."
|
||||||
thread_cache_removearticle($group, $row['number']);
|
thread_cache_removearticle($group, $row['number']);
|
||||||
$i ++;
|
$i ++;
|
||||||
}
|
}
|
||||||
$stmt->execute([':newsgroup' => $group, ':expireme' => $expireme]);
|
$stmt->execute([
|
||||||
|
':newsgroup' => $group,
|
||||||
|
':expireme' => $expireme
|
||||||
|
]);
|
||||||
$dbh = null;
|
$dbh = null;
|
||||||
unlink($lockfile);
|
unlink($lockfile);
|
||||||
touch($spooldir . '/' . $config_name . '-expire-timer');
|
touch($spooldir . '/' . $config_name . '-expire-timer');
|
||||||
echo "Expired " . $i . " articles for " . $group . "\n";
|
echo "Expired " . $i . " articles for " . $group . "\n";
|
||||||
file_put_contents($logfile, "\n".format_log_date()." ".$config_name." Expired ".$i." articles for ".$group, FILE_APPEND);
|
file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " " . $group . " Expired " . $i . " articles", FILE_APPEND);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue