While stealing bits from Affiliates to use in userpoints_no_negative, I was looking at the hook_cron function and think that its if statement is wrong. Currently, the entire function is:

function affiliates_cron() {
  $last_run = variable_get('cron_last', time());
  $interval = variable_get(AFFILIATE_CRON_INTERVAL, 86400);

  if (time() >= $interval) {
    // Refresh the top users data
    _create_summary_data(variable_get(AFFILIATE_TOP_USERS_COUNT_PAGE, 5));

    // Generate the page 
    _get_top_users_page();
    _get_top_climbers_page();

    // Generate the blocks
    _get_top_users_block('total');
    _get_top_users_block('period');
    _get_top_climbers_block();

  }
}

but I believe the if statement really should be:

 if (time() >= ($last_run + $interval)) {

Am I wrong?

Comments

Anonymous’s picture

Assigned: Unassigned »
Status: Active » Fixed

Thanks Fred,

I did spot that few weeks ago and forgot all about it. I'll get that correction committed to the development branch tomorrow.

Paul

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.