function AbstractTransport::checkThrottling
1 call to AbstractTransport::checkThrottling()
- AbstractTransport::send in vendor/
symfony/ mailer/ Transport/ AbstractTransport.php
File
-
vendor/
symfony/ mailer/ Transport/ AbstractTransport.php, line 123
Class
- AbstractTransport
- @author Fabien Potencier <fabien@symfony.com>
Namespace
Symfony\Component\Mailer\TransportCode
private function checkThrottling() : void {
if (0 == $this->rate) {
return;
}
$sleep = 1 / $this->rate - (microtime(true) - $this->lastSent);
if (0 < $sleep) {
$this->logger
->debug(\sprintf('Email transport "%s" sleeps for %.2f seconds', __CLASS__, $sleep));
usleep((int) ($sleep * 1000000));
}
$this->lastSent = microtime(true);
}