Unable to create custom cron jobs using cronapi

Created on 16 June 2016, over 8 years ago
Updated 17 May 2023, over 1 year ago

As per the documentation provided in the module README.txt I have added a cronjob for my module. But the cron is not listed under the "Cron Jobs" admin UI page. Here is the code that I am using:

/**
 * Implements hook_cronapi().
 */
function npq_cronapi($op, $job = NULL) {
  return array(
    'npq_cronjob' => array(
      'title' => 'My custom cron job',
    ),
  );
}

/**
 * Callback for cronjob.
 * @param $job
 */
function npq_cronjob($job) {
  // My cron job to be executed.
}

FYI using the latest 8.x-2.x branch for Ultimate Cron and Drupal 8.1.3

💬 Support request
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India imalabya Bangalore

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇹Italy MrFrankieGio

    I'm able to create a new cronjob with the configuration files, but it seems that doesn't take care about my callback functions. I have the necessity to have multiple tasks for a single module. Is there any rule about the callback naming?
    Thanks

Production build 0.71.5 2024