You are here

public static function BackendBase::setTemporaryRuntimeError in Acquia Purge 8

Set a temporary runtime error.

CDN backends have the ability to temporarily halt all activity for the AcquiaPlatformCdnPurger, for instance for hitting an API rate limit. The runtime error expires automatically after the specified timeout.

Parameters

string $message: Translated user interface message, presentable to users.

int $timeout: Number of seconds after which the runtime error will disappear.

Overrides BackendInterface::setTemporaryRuntimeError

1 call to BackendBase::setTemporaryRuntimeError()
FastlyBackend::fastlyResponseData in src/AcquiaPlatformCdn/FastlyBackend.php
Decode JSON from a Fastly response object body.

File

src/AcquiaPlatformCdn/BackendBase.php, line 79

Class

BackendBase
Provides a backend for the Platform CDN purger.

Namespace

Drupal\acquia_purge\AcquiaPlatformCdn

Code

public static function setTemporaryRuntimeError($message, $timeout = 300) {
  \Drupal::cache()
    ->set('acquia_purge_cdn_runtime_error', $message, time() + $timeout);
}