Don't send a quintillion emails every time mysql restarts.
This commit is contained in:
parent
6d85acc413
commit
bcf211e9dc
6
boot.php
6
boot.php
@ -1239,7 +1239,13 @@ function check_config(&$a) {
|
|||||||
$func = 'update_r' . $x;
|
$func = 'update_r' . $x;
|
||||||
$retval = $func();
|
$retval = $func();
|
||||||
if($retval) {
|
if($retval) {
|
||||||
|
// Prevent sending hundreds of thousands of emails by creating
|
||||||
|
// a lockfile. view/tpl/smarty3 is the only place we can
|
||||||
|
// guarantee the server can write to.
|
||||||
|
if (file_exists('view/tpl/smarty3/mailsent'))
|
||||||
|
return;
|
||||||
//send the administrator an e-mail
|
//send the administrator an e-mail
|
||||||
|
file_put_contents('view/tpl/smarty3/mailsent', $x);
|
||||||
|
|
||||||
$email_tpl = get_intltext_template("update_fail_eml.tpl");
|
$email_tpl = get_intltext_template("update_fail_eml.tpl");
|
||||||
$email_msg = replace_macros($email_tpl, array(
|
$email_msg = replace_macros($email_tpl, array(
|
||||||
|
Reference in New Issue
Block a user