From bcf211e9dcc71248ff4e06e4f80ad1b8b27a4df7 Mon Sep 17 00:00:00 2001 From: Thomas Willingham Date: Thu, 10 Oct 2013 21:24:04 +0100 Subject: Don't send a quintillion emails every time mysql restarts. --- boot.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index fac05af9e..8b004d6c0 100755 --- a/boot.php +++ b/boot.php @@ -1239,7 +1239,13 @@ function check_config(&$a) { $func = 'update_r' . $x; $retval = $func(); 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 + file_put_contents('view/tpl/smarty3/mailsent', $x); $email_tpl = get_intltext_template("update_fail_eml.tpl"); $email_msg = replace_macros($email_tpl, array( -- cgit v1.2.3