You are here

function background_process_ass_init in Background Process 7.2

Implements hook_init().

File

background_process_ass/background_process_ass.module, line 35
@todo Implement admin interface. @todo Fix runtime check of running process.

Code

function background_process_ass_init() {

  // @todo Automatically determine max clients
  return;
  $cache = cache_get('background_process_ass_max_clients');
  if (!$cache) {
    $cache = (object) array(
      'data' => array(),
    );
    $service_hosts = background_process_get_service_hosts();
    foreach ($service_hosts as $name => $info) {
      $ass = $name . '_ass';
      if (!empty($service_hosts[$ass])) {

        // Get max clients from server status here ...

        #$cache->data[$name] = $max_clients;
      }
    }
  }
  global $conf;
  foreach ($cache->data as $service_host => $max_clients) {
    if (!isset($conf[$service_host]['max_clients'])) {
      $conf[$service_host]['max_clients'] = $max_clients;
    }
  }
}