luceos I still encounter the problem of the queue automatically stops after a long running.

the supervisor is active

AS I checked the work log , this is what is recorded during the time it stopped.

[2022-05-23 03:26:28][pOhm8rCUCQj9rBrDsL3f3ba1n5IguSge] Processing: Flarum\Subscriptions\Job\SendReplyNotification
[2022-05-23 03:26:28][pOhm8rCUCQj9rBrDsL3f3ba1n5IguSge] Processed: Flarum\Subscriptions\Job\SendReplyNotification
[2022-05-23 03:26:40][ZgUXeyI2uRTClwFxGmcBk2ZVKTAeVpI3] Processing: Kilowhat\RichEmbeds\Jobs\ProcessUrl
PHP Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/askvortsov/flarum-auto-moderator/src/Action/ActivateEmail.php on line 30
Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/askvortsov/flarum-auto-moderator/src/Action/ActivateEmail.php on line 30
PHP Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/askvortsov/flarum-auto-moderator/src/Action/ActionDriverInterface.php on line 37
Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/askvortsov/flarum-auto-moderator/src/Action/ActionDriverInterface.php on line 37
PHP Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/askvortsov/flarum-auto-moderator/src/Action/AddToGroup.php on line 34
Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/askvortsov/flarum-auto-moderator/src/Action/AddToGroup.php on line 34
PHP Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/askvortsov/flarum-auto-moderator/src/Action/RemoveFromGroup.php on line 36
Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/askvortsov/flarum-auto-moderator/src/Action/RemoveFromGroup.php on line 36
PHP Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/askvortsov/flarum-auto-moderator/src/Action/Suspend.php on line 40
Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/askvortsov/flarum-auto-moderator/src/Action/Suspend.php on line 40
PHP Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/askvortsov/flarum-auto-moderator/src/Action/Unsuspend.php on line 32
Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/askvortsov/flarum-auto-moderator/src/Action/Unsuspend.php on line 32
PHP Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/v17development/flarum-user-badges/src/AutoModerator/Action/GiveBadge.php on line 50
Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/v17development/flarum-user-badges/src/AutoModerator/Action/GiveBadge.php on line 50
PHP Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/v17development/flarum-user-badges/src/AutoModerator/Action/RemoveBadge.php on line 35
Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/v17development/flarum-user-badges/src/AutoModerator/Action/RemoveBadge.php on line 35
[2022-05-23 03:42:48][Xith3DaicdQK586merozk0ROYelCHANH] Processing: Flarum\Notification\Job\SendNotificationsJob

Does it indicates to sth about the Auto moderator extension? Or it just simply sth I didn't notice?

my configuration just copy from above

[program:any_name]
process_name=%(program_name)s_%(process_num)02d
command=php flarum queue:work sqs --sleep=5 --tries=5
directory=/www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn
autostart=true
autorestart=true
user=root
numprocs=1
redirect_stderr=true
stdout_logfile=/www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/worker.log
stopwaitsecs=3600

as i rechecked the configuration, i feel not sure about the red part. But I couldn't restart the supervisor no matter what I changed for the red part( Tried sth like process _name=%(any_name)s_%(5)02d)

    Teddan PHP Deprecated: Required parameter $lastEditedBy follows optional parameter $settings in /www/wwwroot/www.xn--fmrv2rkpbv8uymm.cn/vendor/askvortsov/flarum-auto-moderator/src/Action/ActivateEmail.php on line 30

    Yeah that is related to auto moderator from @askvortsov .

    Teddan But I couldn't restart the supervisor no matter what I changed for the red part

    It's running now, what did you change?

    a month later

    Hi,
    I'm install Flarum via docker on my Synology Nas. And this is my volumes.
    I'm a newbie, sorry for my stupid question 😃 Could you please let me know where is extend.php file to config ?
    Thank you so much!

    ![

      12 days later

      Cagdas

      luceos This is an advanced utility for webmasters! It is not an extension and won't be visible in the admin area. Configuration can be done using a local extender or the glowingblue redis setup extension.

      hau your docker image seems incomplete, so there's no extend.php.

        luceos

        How can I check it is working.

        I think I set it right

          Cagdas it's working if php flarum shows new commands for queue.

            Cagdas can you copy the entire contents of your extend.php?

              luceos

              <?php
              
              /*
               * This file is part of Flarum.
               *
               * For detailed copyright and license information, please view the
               * LICENSE file that was distributed with this source code.
               */
              
              use Flarum\Extend;
              
              return [
                  // Register extenders here to customize your forum!
              ];
              
              return [
                  new Blomstra\Redis\Extend\Redis([
                      'host' => '172.17.0.7',
                      'password' => null,
                      'port' => 6379,
                      'database' => 1,
                  ])
              ];

                Cagdas modify to this:

                <?php
                
                /*
                 * This file is part of Flarum.
                 *
                 * For detailed copyright and license information, please view the
                 * LICENSE file that was distributed with this source code.
                 */
                
                use Flarum\Extend;
                
                return [
                    new Blomstra\Redis\Extend\Redis([
                        'host' => '172.17.0.7',
                        'password' => null,
                        'port' => 6379,
                        'database' => 1,
                    ])
                ];

                  luceos

                  I think it works now. When I refresh the page, I see activity.

                  2 months later

                  luceos As i am installing this extension for the first time .... should i go for Advanced configuration also ?

                  Or Set up is enough ?

                  Edit - I want only cache ... can you pleaes guide what config should i do ?

                    xasharma

                    Add this to the extend.php in your flarum installation path:

                        (new Blomstra\Redis\Extend\Redis([
                            'host' => '127.0.0.1',
                            'password' => null,
                            'port' => 6379,
                            'database' => 1,
                        ]))->disable(['session', 'queue'])

                    This needs to be added inside:

                    return [
                        // .. here
                    ];

                    For most environments this should be enough. If you have installed redis on your vm, then this suffices. If you use a managed solution you will need to use the credentials provided to you.

                      luceos

                      [07-Sep-2022 17:56:05 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 15
                      [07-Sep-2022 17:56:05 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 18
                      [07-Sep-2022 17:56:05 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 45
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Undefined property: stdClass::$included in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 90
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  foreach() argument must be of type array|object, null given in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 90
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Undefined property: stdClass::$data in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 97
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Attempt to read property "attributes" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 97
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Attempt to read property "commentCount" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 97
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Undefined property: stdClass::$data in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 99
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Attempt to read property "attributes" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 99
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Attempt to read property "title" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 99
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Undefined property: stdClass::$data in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Attempt to read property "attributes" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Attempt to read property "slug" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Undefined property: stdClass::$data in /home/hacksnat/public_html/storage/views/5afb52e362293fbbea0c9941a125e51c52000be3.php on line 2
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Attempt to read property "attributes" on null in /home/hacksnat/public_html/storage/views/5afb52e362293fbbea0c9941a125e51c52000be3.php on line 2
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Attempt to read property "title" on null in /home/hacksnat/public_html/storage/views/5afb52e362293fbbea0c9941a125e51c52000be3.php on line 2
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Undefined property: stdClass::$data in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Attempt to read property "attributes" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Attempt to read property "slug" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 1
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 14
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 15
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 18
                      [07-Sep-2022 17:56:08 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 45
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Undefined property: stdClass::$included in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 90
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  foreach() argument must be of type array|object, null given in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 90
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Undefined property: stdClass::$data in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 97
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Attempt to read property "attributes" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 97
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Attempt to read property "commentCount" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 97
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Undefined property: stdClass::$data in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 99
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Attempt to read property "attributes" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 99
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Attempt to read property "title" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 99
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Undefined property: stdClass::$data in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Attempt to read property "attributes" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Attempt to read property "slug" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Undefined property: stdClass::$data in /home/hacksnat/public_html/storage/views/5afb52e362293fbbea0c9941a125e51c52000be3.php on line 2
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Attempt to read property "attributes" on null in /home/hacksnat/public_html/storage/views/5afb52e362293fbbea0c9941a125e51c52000be3.php on line 2
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Attempt to read property "title" on null in /home/hacksnat/public_html/storage/views/5afb52e362293fbbea0c9941a125e51c52000be3.php on line 2
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Undefined property: stdClass::$data in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Attempt to read property "attributes" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Attempt to read property "slug" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 1
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 14
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 15
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 18
                      [07-Sep-2022 17:56:12 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 45
                      [07-Sep-2022 17:56:15 UTC] PHP Warning:  Undefined array key "data" in /home/hacksnat/public_html/vendor/flarum/core/src/Frontend/Content/CorePayload.php on line 74
                      [07-Sep-2022 17:56:22 UTC] PHP Warning:  Undefined array key "data" in /home/hacksnat/public_html/vendor/flarum/core/src/Frontend/Content/CorePayload.php on line 74
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Undefined property: stdClass::$included in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 90
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  foreach() argument must be of type array|object, null given in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 90
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Undefined property: stdClass::$data in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 97
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Attempt to read property "attributes" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 97
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Attempt to read property "commentCount" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 97
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Undefined property: stdClass::$data in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 99
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Attempt to read property "attributes" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 99
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Attempt to read property "title" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 99
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Undefined property: stdClass::$data in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Attempt to read property "attributes" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Attempt to read property "slug" on null in /home/hacksnat/public_html/vendor/flarum/core/src/Forum/Content/Discussion.php on line 84
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Undefined property: stdClass::$data in /home/hacksnat/public_html/storage/views/5afb52e362293fbbea0c9941a125e51c52000be3.php on line 2
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Attempt to read property "attributes" on null in /home/hacksnat/public_html/storage/views/5afb52e362293fbbea0c9941a125e51c52000be3.php on line 2
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Attempt to read property "title" on null in /home/hacksnat/public_html/storage/views/5afb52e362293fbbea0c9941a125e51c52000be3.php on line 2
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 1
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 14
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 15
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 18
                      [07-Sep-2022 17:56:23 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/hacksnat/public_html/storage/views/63b527b40c6d6e1288295c9e975d20ccaa4ec6f1.php on line 45

                        xasharma well it looks like you need to use the right settings to make Flarum connect to your Redis server, is one running?

                        Flarum layout is broken in this thread---no navigation on the right side!§!

                          a month later

                          Pardon me for asking these questions as I'm still trying to learn these computer concepts.

                          1. How does this differ from the regular redis-server installation: sudo apt install redis-server?

                          2. If I understood it correctly, I use this command: composer require blomstra/flarum-redis:* after I already have a redis-server on my VPS so Flarum could make full good use of redis?

                          3. Is this solely to be used for pairing with the Realtime extension?

                          Thanks in advance for your responses.

                            Lurker I'm not a user of the extension myself but as I understand:

                            1-2: you need both a working redis server and the extension. The extension merely makes Flarum connect to the existing server. If you're installing your VPS from scratch, you will likely need to run both the apt and composer commands.

                            3: no, it will cause all queuable jobs in Flarum to be handled by Redis, most notably sending the email notifications but also any other queuable job defined by any extension. I'm not sure this is a requirement for the Realtime extension at all (?)

                              clarkwinkelmann: Thanks a lot! Everything makes sense now.

                              A few more questions if I may:

                              1. Will installing this extension make your forum faster or more efficient in handling tasks?
                              2. What is the difference between the 3 advanced configuration modes: (a) disable specific services, (b) use different database for each service, and (c) separate the config array?

                                Lurker Will installing this extension make your forum faster or more efficient in handling tasks?

                                I wrote a bit about the needs of a queue on the database queue discussion: https://discuss.flarum.org/d/28151
                                The difference between the database queue and the redis queue is that the database queue is easier to use. But it's less instant.

                                Lurker What is the difference between the 3 advanced configuration modes: (a) disable specific services, (b) use different database for each service, and (c) separate the config array?

                                Under normal circumstances just use the default mode. You can use the more complex configuration to separate queue vs session handling into different redis databases. This could be handy for measuring sizes of these databases more easily.

                                  luceos Make sure to start your queue workers, see the laravel documentation for specifics.

                                  The documentation highlights Laravel. Does it mean I also have to install that to try this out?

                                  luceos Under normal circumstances just use the default mode.

                                  Edited after reading a blog from redis.com regarding separating databases

                                  I realized that it’s better to run Redis with a single database as the workload is not entirely split independently by different databases. Numbered databases aren’t supported by any clustering system (open source nor Redis Enterprise clustering). They would instead recommend running multiple instances of Redis if the purpose was to isolate each workload. I don’t know if this made sense but that is my takeaway from the blog.

                                  Disclaimer: I don’t have a background in any computer field apart from using Microsoft Office so I could be wrong. 😂

                                    Lurker The documentation highlights Laravel. Does it mean I also have to install that to try this out?

                                    Not at all. Flarum uses components from Laravel and as such it was easy porting the queue logic over. Referring to the Laravel documentation is done because the instructions for starting and running queues is very good.

                                    Lurker I realized that it’s better to run Redis with a single database as the workload is not entirely split independently by different databases.

                                    To over 95% of people here, this does not matter at all. But yes, clustered setups usually don't support database separation. That's also why database separation requires customization using the extender.

                                    One of the reasons you might want to customize these settings if you run multiple Flarum instances using the same Redis server. To prevent conflicts, you would either need to store each Flarum instance in a different database or use a prefix.

                                    Lurker Disclaimer: I don’t have a background in any computer field apart from using Microsoft Office so I could be wrong.

                                    You're doing great 💪

                                    luceos: I appreciate the explanation.

                                    One more question, if I may. In the FAQ section, this is added: How do I configure a redis socket? Is this needed in the basic setup? Thanks!

                                      I tried installing this using the basic setup, but I seem to be getting this error:

                                      In AbstractConnection.php line 132:
                                         `SELECT` failed: NOAUTH Authentication required. [tcp://127.0.0.1:6379]

                                      When I run systemctl status redis it's saying that it is active (running).

                                      I tried to troubleshoot by replacing "null" in the password section of extend.php with my redis password, but I'm getting this error instead:

                                      PHP Parse error: syntax error, unexpected identifier "password" expecting "]" in /var/www/website/forum/extend.php on line 16

                                      Now, I can't even access my forum as all I see is white screen. Lol. Good thing I took a snapshot of my droplet before attempting to install redis.

                                      Did I miss something in the installation? Your help would be immensely appreciated. Thanks!

                                        Lurker the error is caused by a missing comma at the end of the previous line above password. Copy the contents of extend.php (mask the actual passwords) so that I can correct them (or send it on discord dm).

                                          5 days later

                                          luceos Copy the contents of extend.php (mask the actual passwords) so that I can correct them

                                          Please accept my apologies for the delayed response. I was trying to solve it to the best of my abilities, but I give up. 🤦‍♂️

                                          I added a comma after the host, password, port and database but now I'm getting a new error:
                                          PHP Parse error: syntax error, unexpected single-quoted string "port", expecting "]" in /var/www/website/forum/extend.php on line 17

                                          Here's the content of my extend.php:

                                          <?php
                                          
                                          /*
                                           * This file is part of Flarum.
                                           *
                                           * For detailed copyright and license information, please view the
                                           * LICENSE file that was distributed with this source code.
                                           */
                                          
                                          use Flarum\Extend;
                                          
                                          return [
                                              // Register extenders here to customize your forum!
                                              (new Blomstra\Redis\Extend\Redis([
                                                  'host' => '127.0.0.1',
                                                  'password' => password,
                                                  'port' => 6379,
                                                  'database' => 1,
                                              ]))
                                              ->useDatabaseWith('cache', 1)
                                              ->useDatabaseWith('queue', 2)
                                              ->useDatabaseWith('session', 3)
                                          ];

                                          Additional questions if I may:
                                          How does the Flarum-Redis differ from the other Blomstra extension: Realtime? If I understood the concepts correctly, the latter utilizes the master:slave system of Redis to queue tasks such as email sending; while the former takes it up to the next level by allowing all notifications to be pushed. Is that right?

                                          Thank you in advance for the help. 😀

                                            Lurker the new error seems to be caused by the password line, make sure to encapsulate the password in quotes and escape those quotes if they exist inside said password. If you have issues with this DM me on Discord with your exact extend.php for further help.

                                            Lurker Additional questions if I may:
                                            How does the Flarum-Redis differ from the other Blomstra extension: Realtime? If I understood the concepts correctly, the latter utilizes the master:slave system of Redis to queue tasks such as email sending; while the former takes it up to the next level by allowing all notifications to be pushed. Is that right?

                                            The realtime extension puts notifications it sends to users connected to the realtime websocket into a queue. Especially on larger communities using a queue becomes necessary as notification handling can delay processing of requests (like posting) up to a point where they seem to fail. This extension/package offers one form of queue, using redis, which is a very reliable set up.

                                              luceos make sure to encapsulate the password in quotes and escape those quotes if they exist inside said password

                                              Ahhh! This solved the PHP parse error. I think I missed the quotation marks as the password line of the guide only showed: 'password' => null,

                                              After entering the command php flarum queue:work all I see is a blank line signifying that the workers are waiting for a task. The document states that once the queue:work command has started, it will continue to run until it is manually stopped or you close your terminal; but how do I make it manually stop without closing the terminal? Is it possible to keep it running in the background?

                                              Edited after reading all 233 posts

                                              Solution: There is no need to stop the process. The recommendation is to run it continuously with supervisor or systemd.

                                              For systemd, @matteocontrini, an excellent community member, suggests the following (added some lines for clarity)

                                              On distributions with systemd (e.g. Ubuntu), it's also possible to create a system service without installing anything.

                                              Create a file with an editor of your choice at /etc/systemd/system/flarum-queue.service with the following contents:

                                              [Unit]
                                              Description=flarum-queue
                                              After=network.target
                                              StartLimitIntervalSec=0

                                              [Service]
                                              Type=simple
                                              User=www-data
                                              WorkingDirectory=/var/www/path-to-flarum
                                              ExecStart=/usr/bin/php-version flarum queue:work
                                              Restart=always
                                              RestartSec=5

                                              [Install]
                                              WantedBy=multi-user.target

                                              To start the service:
                                              $sudo systemctl start flarum-queue.service

                                              To automatically start on reboots:
                                              $sudo systemctl enable flarum-queue.service

                                              I hope this helps other users.

                                              luceos This extension/package offers one form of queue, using redis, which is a very reliable set up.

                                              Can Flarum-Redis be run together with Blomstra-Realtime on the same Flarum community? From my understanding, both of them serve the same purpose, but I could be wrong. I'm still trying to wrap my head around the concept of a websocket so I truly appreciate your patience.

                                                Lurker Can Flarum-Redis be run together with Blomstra-Realtime on the same Flarum community?

                                                Yes they co-exist. In fact Realtime works better if a queue extension is enabled/working.

                                                Lurker From my understanding, both of them serve the same purpose, but I could be wrong.

                                                Yes you are wrong. Which I can completely understand. Let me try to narrow it down.

                                                Realtime makes Flarum more realtime by sending updates to the Flarum community html page you have open directly through a two-way continuous communication channel. For instance new posts being rendered inside a discussion, new discussions onto the index and the typing indicator without having to refresh the page; it does not add any backend functionality to move task processing (like sending notifications) to a queue.

                                                Blomstra Redis does not add any realtime updates to Flarum, it enables tasks to be processed in the background. Instead of having to wait for notifications (and other php/backend tasks) to be completed, a user on your community can simply post and see their post on the forum immediately. The more background tasks are scheduled when creating content, the longer the request to submit that content, unless you use a queue. Blomstra Redis enables a queue relying on Redis, Blomstra database queue enables one relying on the database.

                                                Additional resources:

                                                I was able to successfully create the flarum-queue.service file and had it started and enabled. This is the status of my flarum-queue.service:

                                                 flarum-queue.service - flarum-queue
                                                     Loaded: loaded (/etc/systemd/system/flarum-queue.service; enabled; vendor>
                                                     Active: active (running) since Wed 2022-10-26 15:07:12 UTC; 10s ago
                                                   Main PID: 8910 (php8.1)
                                                      Tasks: 1 (limit: 1116)
                                                     Memory: 28.0M
                                                        CPU: 218ms
                                                     CGroup: /system.slice/flarum-queue.service
                                                             └─8910 /usr/bin/php8.1 flarum queue:work

                                                However, when I tried to login to my site, I get this message:
                                                Oops! Something went wrong. Please reload the page and try again.

                                                I can't seem to log in to my own site now. I tried resetting my password, but it's saying that "An error occured. Please try again."

                                                Solution: Clear the Flarum cache by typing: php flarum cache:clear

                                                If you get a permission error like this:

                                                Could not clear contents of storage/cache. Please adjust file permissions and try again. This can frequently be fixed by clearing cache via the Tools dropdown on the Administration Dashboard page.

                                                Solution: Run the command as the web user by typing sudo -u www-data php flarum cache:clear

                                                Edited after several readings and droplet restores. Personal issues have now been resolved. Thanks!

                                                2 months later
                                                3 months later

                                                Hi, nice extension ! Is there a way to use config.php to enable / disable your extension ? Because I haven't Redis on my local environment.

                                                  6 days later

                                                  It makes verification mail cannot send correctly when I use Redis.
                                                  That mail was sent correctly When I disabled Redis.
                                                  Is there any solution to fix this?

                                                    luceos
                                                    I ran command:

                                                    php flarum info