You are here

function _elasticsearch_check_if_cluster_locked in Elasticsearch Connector 8.6

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

Checks if other modules have locked the cluster.

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

Parameters

object $cluster: The fully loaded Cluster object.

Return value

array Array with clusters locked for deletion.

File

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

Code

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