| 1 |
<?php |
<?php |
| 2 |
// $Id: poormanscron.module,v 1.21.2.2 2009/05/06 05:07:08 robloach Exp $ $Name: $ |
// $Id: poormanscron.module,v 1.22.2.1 2009/09/29 22:31:58 davereid Exp $ $Name: $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 53 |
* @see poormanscron_run_cron_check_access() |
* @see poormanscron_run_cron_check_access() |
| 54 |
*/ |
*/ |
| 55 |
function poormanscron_run_cron_check() { |
function poormanscron_run_cron_check() { |
| 56 |
// Because we don't have a good way to disable a page from being cached |
// Because we don't have a good way to disable a page from being cached (like |
| 57 |
// (like using page_is_cacheable in Drupal 7), we have to use this ugly hack. |
// using page_is_cacheable() in Drupal 7), we have to use this ugly hack. |
| 58 |
$_SERVER['REQUEST_METHOD'] = 'POST'; |
$_SERVER['REQUEST_METHOD'] = 'POST'; |
| 59 |
|
|
| 60 |
$cron_run = FALSE; |
$cron_run = FALSE; |
| 63 |
// Cron threshold semaphore is used to avoid errors every time the image |
// Cron threshold semaphore is used to avoid errors every time the image |
| 64 |
// callback is displayed when a previous cron is still running. |
// callback is displayed when a previous cron is still running. |
| 65 |
$threshold_semaphore = variable_get('cron_threshold_semaphore', FALSE); |
$threshold_semaphore = variable_get('cron_threshold_semaphore', FALSE); |
| 66 |
if ($threshold_semaphore) { |
if ($threshold_semaphore = variable_get('cron_threshold_semaphore', FALSE)) { |
| 67 |
if ($time - $threshold_semaphore > 3600) { |
if ($time - $threshold_semaphore > 3600) { |
| 68 |
// Either cron has been running for more than an hour or the semaphore |
// Either cron has been running for more than an hour or the semaphore |
| 69 |
// was not reset due to a database error. |
// was not reset due to a database error. |