function _provision_drush_check_load

7.x-3.x provision.drush.inc _provision_drush_check_load()

This will abort any process running drush if the load is critical.

See also

provision_load_critical()

Related topics

1 call to _provision_drush_check_load()
provision_drush_init in ./provision.drush.inc
Implements hook_drush_init().

File

./provision.drush.inc, line 80
Provision Drush commands.

Code

function _provision_drush_check_load() {
  $load = sys_getloadavg();
  if (provision_load_critical($load)) {
    drush_set_error('PROVISION_OVERLOAD', dt("load on system too heavy (@load), aborting", array('@load' => join(" ", $load))));
    exit(1);
  }
}