Check if running standalone before running spoolnews.php as it's not necessary

This commit is contained in:
Retro_Guy 2021-11-18 03:20:32 +00:00
parent a420644129
commit a14736bc33
2 changed files with 7 additions and 3 deletions

View File

@ -60,6 +60,7 @@ foreach($menulist as $menu) {
}
$menuitem=explode(':', $menu);
chdir("../".$menuitem[0]);
if($CONFIG['remote_server'] !== '') {
# Send articles
echo "Sending articles\n";
echo exec($CONFIG['php_exec']." ".$config_dir."/scripts/send.php");
@ -68,6 +69,7 @@ foreach($menulist as $menu) {
exec($CONFIG['php_exec']." ".$config_dir."/scripts/spoolnews.php");
echo "Refreshed spoolnews\n";
}
}
# Expire articles
exec($CONFIG['php_exec']." ".$config_dir."/scripts/expire.php");
echo "Expired articles\n";

View File

@ -995,14 +995,16 @@ function insert_article($section,$nntp_group,$filename,$subject_i,$from_i,$artic
$date_i,$mid_i,$references_i,$bytes_i,$lines_i,$xref_i,$body) {
global $enable_rslight,$spooldir,$CONFIG,$logdir,$lockdir,$logfile;
if($CONFIG['remote_server'] !== '') {
$sn_lockfile = $lockdir . '/'.$section.'-spoolnews.lock';
$sn_pid = file_get_contents($sn_lockfile);
if (posix_getsid($sn_pid) === false || !is_file($sn_lockfile)) {
file_put_contents($sn_lockfile, getmypid()); // create lockfile
} else {
} else {
file_put_contents($logfile, "\n".format_log_date()." ".$section." Queuing local post: ".$nntp_group, FILE_APPEND);
return(1);
}
return(1);
}
}
$local_groupfile=$spooldir."/".$section."/local_groups.txt";
$path=$spooldir."/articles/";
$grouppath = $path.preg_replace('/\./', '/', $nntp_group);