Skip to content

Instantly share code, notes, and snippets.

@Mihailoff
Created September 10, 2013 13:02
Show Gist options
  • Save Mihailoff/6509080 to your computer and use it in GitHub Desktop.
Save Mihailoff/6509080 to your computer and use it in GitHub Desktop.
Drush command to help debug cron timeout errors
drush php-eval 'global $timers; $hook = 'cron'; $return = array(); foreach (module_implements($hook) as $module) { $function = $module . '_' . $hook; print($function ." - "); timer_start($function); $result = call_user_func_array($function, array()); if (isset($result) && is_array($result)) { $return = array_merge_recursive($return, $result); } else if (isset($result)) { $return[] = $result; } timer_stop($function); print($timers[$function]['time'] ."\r\n"); }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment