function elysia_cron_lock_env in Elysia Cron 7.2
Same name and namespace in other branches
- 6.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 1190
Code
function elysia_cron_lock_env($channel = NULL) {
$execute = TRUE;
$semaphore_name = elysia_cron_build_semaphore_name($channel);
if (!lock_acquire($semaphore_name, 240)) {
elysia_cron_warning('Attempting to re-run cron while it is already running.');
$execute = FALSE;
}
return $execute;
}