eriktobben
1 year ago

Horizon runs job multiple times

Posted 1 year ago by eriktobben

Hi!

I have just installed Horizon, and set my QUEUE_DRIVER to redis in .env-file. When I run php artisan horizon the job gets executed four times.

I have no info in Horizon dashboard, and the status is a cross.

.env

QUEUE_DRIVER=redis
HORIZON_PREFIX=projectone:

config/horizon.php

'use' => 'default',

'prefix' => env('HORIZON_PREFIX', 'horizon:'),

'waits' => [
        'redis:default' => 60,
    ],


'environments' => [
        'production' => [
            'supervisor-1' => [
                'connection' => 'redis',
                'queue' => ['default'],
                'balance' => 'auto',
                'processes' => 10,
                'tries' => 3,
            ],
        ],

        'local' => [
            'supervisor-1' => [
                'connection' => 'redis',
                'queue' => ['default'],
                'balance' => 'auto',
                'processes' => 3,
                'tries' => 3,
            ],
        ],
    ],

Terminal

[2017-12-31 21:17:27] Processing: App\Jobs\GenerateInvoice
[2017-12-31 21:17:32] Processing: App\Jobs\GenerateInvoice
[2017-12-31 21:17:32] Processing: App\Jobs\GenerateInvoice
[2017-12-31 21:17:32] Failed:     App\Jobs\GenerateInvoice

The error message for the failed job is just because the file name already exists.

Please sign in or create an account to participate in this conversation.