You are here

function db_ignore_replica in Drupal 8

Sets a session variable specifying the lag time for ignoring a replica server (A replica server is traditionally referred to as a "slave" in database server documentation).

Deprecated

in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal::service('database.replica_kill_switch')->trigger() instead.

See also

https://www.drupal.org/node/2997500

https://www.drupal.org/node/2275877

1 call to db_ignore_replica()
DatabaseLegacyTest::testDbIgnoreReplica in core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php
Tests the db_ignore_replica() function.

File

core/includes/database.inc, line 1140
Core systems for the database layer.

Code

function db_ignore_replica() {
  @trigger_error('db_ignore_replica() is deprecated in drupal:8.7.0. It will be removed from drupal:9.0.0. Use \\Drupal\\Core\\Database\\ReplicaKillSwitch::trigger() instead. See https://www.drupal.org/node/2997500', E_USER_DEPRECATED);
  \Drupal::service('database.replica_kill_switch')
    ->trigger();
}