• Extensions
  • Database Queue - the simplest queue, even for shared hosting

1.0.2

  • full fix for failed jobs not being displayed correctly
Updating
composer require blomstra/database-queue:"*"
php flarum cache:clear
    a month later

    IanM glad to see the queue extension moved to an official extension, thank you 🙂

    When I used to invoke the queue using flarum queue:work, there were some arguments it supported I think such as --sleep, --tries, --memory, is it possible/necessary to configure those still if upgrading and allowing the scheduler to invoke the queue? Reason being, I need to ensure it has enough memory and by default I believe it's granted 128 MB, but I need to bump that up.

      ctml you make a very good point actually. No, at present it does not support the additional args. It's easy enough to expose these as extensions settings, I'll get this added 🙂

      2 months later

      IanM Hi, I'm a little confused. You mentioned that no cron is required anymore. But the documents still say:

      Set up

      Go into your hosting control panel and set up the following task to run every minute:

      php flarum schedule:run
      Or in cron language:

      • * * * * cd /path/to/flarum && php flarum schedule:run

      Is it the documents/readme that haven't been updated? Just want to make sure things are setup correctly. (I just updated flarum and its extensions).

        xasharma Redis is a different implementation of queues. It's either use Redis or DB queues.

          xasharma

          luceos What is the difference with blomstra/flarum-redis?
          The redis package (it's officially not an extension) is meant for larger communities. Redis offers the ability to scale the number of workers up however you need. Running a queue worker which pulls jobs from the database can also negatively impact your community performance when processing a lot of notifications and other queue tasks.

            a month later

            Today I entered in the Flarum admin where in the Dashboard I see 12 failed job.
            This are reported same in two communities.
            How to know what this failed job are?

              luceos thanks.
              flmaqueue_failed_jobs

              I found the records and those seems to be old by February 2024 so maybe... the plugin queue still showing me old things already resolved. I will delete this from the database.

              A UI for that will be useful and also a way to clean errors 🙂

              2 months later

              I don't know what is happening but every action (no matter if it's updating, installing or removing/deleting extensions) I try to do results in giving this error...

              Cause
              Unknown
              Composer Command
              $ composer
              Output
              Flarum\ExtensionManager\Job\ComposerCommandJob has been attempted too many times or run too long. The job may have previously timed out.

              I have cron set up right as it's been sending me emails with the info of the jobs but for whatever reason the script can't successfully add the extension.

              3 months later

              luceos Go into your hosting control panel and set up the following task to run every minute:

              What does this mean? Like in the administration section, or my web server control panel? I don't understand what exactly I'm supposed to do here.

              Also, when would you say a community becomes a "large" community? Ie, when should I switch from DB to Redis queue?

              EDIT: Nevermind, I set up a cron job. I don't know how to test that it's working though, is there a way?

              Also, what are the best settings for the extension itself?

              @luceos I'm having issues and I don't know what's causing them. I presume my cron job isn't running correctly or something. It keeps showing inactive and jobs don't move from pending.

              Running php flarum schedule:run works to resolve it, and it shows "active" on the dashboard, but obviously manually running it kind of defeats the purpose.

              Here is the cron job I have set up in cPanel.

              And here it is with crontab -e