Throttle emails

This commit is contained in:
Hillel Coren 2018-02-04 11:38:10 +02:00
parent b7081fdcfc
commit 59ffd9c6f8

View File

@ -368,7 +368,7 @@ class ContactMailer extends Mailer
// http://stackoverflow.com/questions/1375501/how-do-i-throttle-my-sites-api-users // http://stackoverflow.com/questions/1375501/how-do-i-throttle-my-sites-api-users
$hour = 60 * 60; $hour = 60 * 60;
$hour_limit = 100; // users are limited to 100 emails/hour $hour_limit = 50; // users are limited to 50 emails/hour
$hour_throttle = Cache::get("email_hour_throttle:{$key}", null); $hour_throttle = Cache::get("email_hour_throttle:{$key}", null);
$last_api_request = Cache::get("last_email_request:{$key}", 0); $last_api_request = Cache::get("last_email_request:{$key}", 0);
$last_api_diff = time() - $last_api_request; $last_api_diff = time() - $last_api_request;