function CachePreWarmer::preWarmOneCache

Prewarms one PreWarmable service.

Return value

bool TRUE if a cache was prewarmed, FALSE if there was nothing to prewarm.

Overrides CachePreWarmerInterface::preWarmOneCache

1 call to CachePreWarmer::preWarmOneCache()
CachePreWarmer::preWarmAllCaches in core/lib/Drupal/Core/PreWarm/CachePreWarmer.php
Prewarms all PreWarmable services.

File

core/lib/Drupal/Core/PreWarm/CachePreWarmer.php, line 59

Class

CachePreWarmer
Prewarms caches for services that implement PreWarmableInterface.

Namespace

Drupal\Core\PreWarm

Code

public function preWarmOneCache() : bool {
  $candidate = array_pop($this->serviceIds);
  if ($candidate === NULL) {
    return FALSE;
  }
  $service = $this->classResolver
    ->getInstanceFromDefinition($candidate);
  $service->preWarm();
  return TRUE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.