aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-10-10 15:25:58 -0700
committerfriendica <info@friendica.com>2013-10-10 15:25:58 -0700
commit71f22b20f44563a19ba242ba941e2fc452fe56ce (patch)
tree93ba6edc8cd34097d4289bda33605177152e4220
parent9533ea995c79556faecd2ed34585452e01aca290 (diff)
parentbcf211e9dcc71248ff4e06e4f80ad1b8b27a4df7 (diff)
downloadvolse-hubzilla-71f22b20f44563a19ba242ba941e2fc452fe56ce.tar.gz
volse-hubzilla-71f22b20f44563a19ba242ba941e2fc452fe56ce.tar.bz2
volse-hubzilla-71f22b20f44563a19ba242ba941e2fc452fe56ce.zip
Merge pull request #173 from beardy-unixer/master
Don't send a quintillion emails every time mysql restarts.
-rwxr-xr-xboot.php6
1 files changed, 6 insertions, 0 deletions
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(