/[drupal]/contributions/modules/poormanscron/poormanscron.module
ViewVC logotype

Diff of /contributions/modules/poormanscron/poormanscron.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.22.2.2, Tue Sep 29 22:36:15 2009 UTC revision 1.22.2.3, Tue Sep 29 22:59:33 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: poormanscron.module,v 1.22.2.1 2009/09/29 22:31:58 davereid Exp $ $Name:  $  // $Id: poormanscron.module,v 1.22.2.2 2009/09/29 22:36:15 davereid Exp $ $Name:  $
3    
4  /**  /**
5   * @file   * @file
# Line 63  function poormanscron_run_cron_check() { Line 63  function poormanscron_run_cron_check() {
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 = variable_get('cron_threshold_semaphore', FALSE)) {    if ($threshold_semaphore) {
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.
# Line 75  function poormanscron_run_cron_check() { Line 75  function poormanscron_run_cron_check() {
75    }    }
76    else {    else {
77      // Run cron automatically if it has never run or threshold was crossed.      // Run cron automatically if it has never run or threshold was crossed.
78      $cron_last = variable_get('cron_last', NULL);      $cron_last = variable_get('cron_last', 0);
79      $cron_threshold = variable_get('cron_safe_threshold', 10800);      $cron_threshold = variable_get('cron_safe_threshold', 10800);
80      if (!isset($cron_last) || ($time - $cron_last > $cron_threshold)) {      if ($time - $cron_last > $cron_threshold) {
81        // Lock cron threshold semaphore.        // Lock cron threshold semaphore.
82        variable_set('cron_threshold_semaphore', $time);        variable_set('cron_threshold_semaphore', $time);
83        $cron_run = drupal_cron_run();        $cron_run = drupal_cron_run();

Legend:
Removed from v.1.22.2.2  
changed lines
  Added in v.1.22.2.3

  ViewVC Help
Powered by ViewVC 1.1.2