Add admin notification of possble broken group.
This commit is contained in:
parent
b5b6f05100
commit
ebf43579ff
|
@ -114,8 +114,28 @@ if ($message) {
|
|||
$thread = thread_load($group);
|
||||
$subthread = thread_getsubthreadids($message->header->id, $thread);
|
||||
if (! $subthread) {
|
||||
$date_window = 86400;
|
||||
$msg_log_file = $spooldir . '/admin_msg_log.dat';
|
||||
echo '<center>Group is rebuilding... Please try again later</center>';
|
||||
file_put_contents($debug_log, "\n" . format_log_date() . " " . $config_name . " GROUP ERROR: " . $group . " may need repair", FILE_APPEND);
|
||||
$msg_from = 'admin';
|
||||
$msg_to = 'admin';
|
||||
$msg_body = format_log_date() . " " . $config_name . " GROUP ERROR: " . $group . " may need repair";
|
||||
$msg_body_2 = "\n\nRun maintenance.php -import " . $group;
|
||||
if (file_exists($msg_log_file)) {
|
||||
$admin_msg_log = unserialize(file_get_contents($msg_log_file));
|
||||
} else {
|
||||
$admin_msg_log = array();
|
||||
}
|
||||
if (! isset($admin_msg_log[$group])) {
|
||||
$admin_msg_log[$group] = 0;
|
||||
}
|
||||
if ($admin_msg_log[$group] < (time() - $date_window)) {
|
||||
$msg_subject = "ERROR in $group";
|
||||
send_admin_message($msg_to, $msg_from, $msg_subject, $msg_body . $msg_body_2);
|
||||
$admin_msg_log[$group] = time();
|
||||
}
|
||||
file_put_contents($msg_log_file, serialize($admin_msg_log));
|
||||
file_put_contents($debug_log, "\n" . $msg_body, FILE_APPEND);
|
||||
exit();
|
||||
}
|
||||
if ($thread_articles == false) {
|
||||
|
|
Loading…
Reference in New Issue