Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SmtpTransport.php

function SmtpTransport::checkRestartThreshold

1 call to SmtpTransport::checkRestartThreshold()
SmtpTransport::send in vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php

File

vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php, line 357

Class

SmtpTransport
Sends emails over SMTP.

Namespace

Symfony\Component\Mailer\Transport\Smtp

Code

private function checkRestartThreshold() : void {
    // when using sendmail via non-interactive mode, the transport is never "started"
    if (!$this->started) {
        return;
    }
    ++$this->restartCounter;
    if ($this->restartCounter < $this->restartThreshold) {
        return;
    }
    $this->stop();
    if (0 < ($sleep = $this->restartThresholdSleep)) {
        $this->getLogger()
            ->debug(\sprintf('Email transport "%s" sleeps for %d seconds after stopping', __CLASS__, $sleep));
        sleep($sleep);
    }
    $this->start();
    $this->restartCounter = 0;
}
RSS feed
Powered by Drupal