You are here

function _elasticsearch_check_if_index_locked in Elasticsearch Connector 8.6

Same name and namespace in other branches
  1. 8.7 elasticsearch_connector.module \_elasticsearch_check_if_index_locked()
  2. 8 elasticsearch_connector.module \_elasticsearch_check_if_index_locked()
  3. 8.2 elasticsearch_connector.module \_elasticsearch_check_if_index_locked()
  4. 8.5 elasticsearch_connector.module \_elasticsearch_check_if_index_locked()

Checks if other modules have locked the index.

In case of major changes on the index settings and deletion the index could be locked. Invokes the hooks similar to the module_invoke.

Parameters

string $cluster: The fully loaded Cluster object.

string $index: The fully loaded Index object.

Return value

array Array with indexes locked for deletion.

File

./elasticsearch_connector.module, line 160
Provides hook implementations and functions accessible from other modules.

Code

function _elasticsearch_check_if_index_locked($cluster, $index) {
  $locked = array();
  if (!empty($cluster)) {
    $type = 'index';
    foreach (module_implements('elasticsearch_edit_lock') as $module) {
      $function = $module . '_elasticsearch_edit_lock';
      $locked_result = $function($type, $cluster, $index);
      if (!empty($locked_result)) {
        $locked[] = $module;
      }
    }
  }
  return $locked;
}