Skip to content

Instantly share code, notes, and snippets.

@rscotton
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rscotton/78e49a96b15acb43de42 to your computer and use it in GitHub Desktop.
Save rscotton/78e49a96b15acb43de42 to your computer and use it in GitHub Desktop.
An example of Drupal's hook_cron_queue_info() in action.
<?php
function profile_cron_queue_info() {
$queues = array(
'import_profiles' => array(
'worker callback' => 'profile_import_profiles’,
'time' => 60*30, //Give a max of 30 minutes per import, this is a large job!
),
'active_status_sync' => array(
'worker callback' => 'profile_active_status_sync',
'time' => 60*10, //Give 10 minutes for this, it is less time consuming
),
);
return $queues;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment