Cron jobs not triggering?

Created on 30 December 2024, 4 months ago

I have some queue workers that I would like to run more frequently than the standard Drupal cron, which I am okay running once every few hours. It seems like this module might be helpful for that.

I am able to see my queues in the UI, and I wanted to set the crontab to run every minute (just as a test). But it didn't seem to ever "trigger" on its own. I can see the "Next run" time in the past. Rather the only way I could see these queues run is when I manually made a request to the URL for each queue's "Single cron job run"

If that is the intended behavior, does that mean to schedule my cron jobs do I need to use an external service? What is the purpose of the "crontab" schedule?

Thanks

πŸ’¬ Support request
Status

Active

Version

1.1

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States srdtwc Skokie, IL

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

Comments & Activities

  • Issue created by @srdtwc
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Do you have a cron job set up on your server to run again the standard cron URL or run drush cron every minute?

    No module can effect your server configuration, what this does is have a single efficient point to stop everything from just running every minute.
    But drupal cron still needs to be hit. Then this module decided which to run or skip.

    So eg:

    • Set up your server cron to trigger drupal cron every minute
    • Without this module: all tasks run every minute
    • With this modile: tasks only run when they are set to run per your schedule, and are otherwise skipped

    The only exception is if in the specific cron job UI for editing your queue worker, you decide to tick the single URL only. Then it won't ever be run by the default cron and you must set up a seperate cron job on your server.

    If your server does not support cron job configuration (eg Pantheon) they have a support page on it I believe.

  • πŸ‡ΊπŸ‡ΈUnited States srdtwc Skokie, IL

    Thank you for the detailed response! I think I understand the workflow now.

    To test this out, I set $config['automated_cron.settings']['interval'] = 120; in settings.php to run cron every 2 minutes.

    Then I configured my queue in Simple Cron to run every 15 minutes. I was able to see cron run every 2 minutes but my queue only ran every 15 minutes as expected.

    So, if I want to have cron run every 3 hours but have my queue run more often than that, I will need to trigger the queue URL some other way, correct?

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Correct but the skipping is quite efficient so you could also just run every minute and skip everything but your queue. Up to you

  • πŸ‡ΊπŸ‡ΈUnited States srdtwc Skokie, IL

    Ah that's a good idea. I feel like I understand how all of this works now.

    Feel free to close this ticket and thank you for your time. Hopefully this thread helps others in the future.

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    No problem at all and happy to help. All the best with your project

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

Production build 0.71.5 2024