You are here

function _elasticsearch_check_if_index_locked in Elasticsearch Connector 8

Same name and namespace in other branches
  1. 8.7 elasticsearch_connector.module \_elasticsearch_check_if_index_locked()
  2. 8.2 elasticsearch_connector.module \_elasticsearch_check_if_index_locked()
  3. 8.5 elasticsearch_connector.module \_elasticsearch_check_if_index_locked()
  4. 8.6 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:

string $index:

Return value

array

File

./elasticsearch_connector.module, line 144
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;
}