You are here

function elysia_cron_internal_execute_channel_completed in Elysia Cron 7.2

Same name and namespace in other branches
  1. 6.2 elysia_cron.module \elysia_cron_internal_execute_channel_completed()

Successful termination (after all shutdown hooks invoked by cron functions).

1 string reference to 'elysia_cron_internal_execute_channel_completed'
elysia_cron_internal_execute_channel in ./elysia_cron.module
Internal function to execute all jobs in a channel.

File

./elysia_cron.module, line 1635

Code

function elysia_cron_internal_execute_channel_completed() {
  global $_elysia_cron_current_channel, $_cron_completed_time;

  // Record cron time.
  _ec_variable_set('cron_last', time());
  elysia_cron_debug('Cron channel %channel run completed.', array(
    '%channel' => $_elysia_cron_current_channel,
  ));
  $stats = elysia_cron_get_channel_stats($_elysia_cron_current_channel);
  $time = time() - $stats['last_run'];
  $exec_count = $stats['execution_count'] + 1;
  $channel_stats_data = array(
    'last_execution_time' => $time,
    'execution_count' => $exec_count,
    'avg_execution_time' => round(($stats['avg_execution_time'] * ($exec_count - 1) + $time) / $exec_count, 2),
    'max_execution_time' => $time > $stats['max_execution_time'] ? $time : $stats['max_execution_time'],
    'last_shutdown_time' => time() - $_cron_completed_time,
    'last_aborted' => 0,
    'running' => 0,
  );
  elysia_cron_set_channel_stats($_elysia_cron_current_channel, $channel_stats_data);
}