You are here

function elysia_cron_lock_env in Elysia Cron 6.2

Same name and namespace in other branches
  1. 7.2 elysia_cron.module \elysia_cron_lock_env()

Use this before checking and modifying environment variables.

@see: elysia_cron_prepare_run()

2 calls to elysia_cron_lock_env()
elysia_cron_run in ./elysia_cron.module
Public function to invoke a complete cron_run
elysia_cron_run_channel in ./elysia_cron.module
Public function to execute all jobs in a channel

File

./elysia_cron.module, line 994

Code

function elysia_cron_lock_env() {
  $execute = true;
  if (EC_DRUPAL_VERSION >= 7) {
    if (!lock_acquire('cron', 240.0)) {
      elysia_cron_warning('Attempting to re-run cron while it is already running.');
      $execute = false;
    }
  }
  else {

    // Global Semaphore to avoid concurrent execution of cron preparation code
    $execute = _ec_semaphore_get('elysia_cron_semaphore', 120);
  }
  return $execute;
}