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

Breadcrumb

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

function CurlDownloader::restartJobWithDelay

Parameters

Job $job:

non-empty-string $url:

array{retryAuthFailure?: bool, redirects?: int<0, max>, storeAuth?: 'prompt'|bool, retries: int<1, max>, ipResolve?: 4|6} $attributes:

1 call to CurlDownloader::restartJobWithDelay()
CurlDownloader::tick in vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php

File

vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php, line 616

Class

CurlDownloader
@internal @author Jordi Boggiano <j.boggiano@seld.be> @author Nicolas Grekas <p@tchwork.com> @phpstan-type Attributes array{retryAuthFailure: bool, redirects: int<0, max>, retries: int<0, max>, storeAuth:…

Namespace

Composer\Util\Http

Code

private function restartJobWithDelay(array $job, string $url, array $attributes) : void {
    if ($attributes['retries'] >= 3) {
        usleep(500000);
        // half a second delay for 3rd retry and beyond
    }
    elseif ($attributes['retries'] >= 2) {
        usleep(100000);
        // 100ms delay for 2nd retry
    }
    // no sleep for the first retry
    $this->restartJob($job, $url, $attributes);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal