mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 15:44:33 -04:00
Throttle emails
This commit is contained in:
parent
b7081fdcfc
commit
59ffd9c6f8
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user