L5.7 Redis将我排队的作业和失败的作业保存在哪里?

时间:2018-10-23 21:11:38

标签: laravel redis laravel-queue

第一次使用Redis,所以我找到了解决方法。使用Redsmind for GUI,我找不到Redis在哪里保存排队的作业和失败的作业。我以为它将在database.php中定义的数据库“ 10”中,但是Resdmind什么也没显示。

我使用Horizo​​n可以很好地处理工作。我设置了5分钟的延迟,因此应该在Redis中显示。

// queue.php
'connections' => [

    'redis' => [
        'driver' => 'redis',
        'connection' => 'queue',
        'queue' => 'default',
        'retry_after' => 90,
        'block_for' => 5
    ],
],

// database.php
'redis' => [
    'client' => 'predis',

    // 'cluster' => false,
    'cache' => [
        'host' => env('REDIS_HOST', '127.0.0.1'),
        'password' => env('REDIS_PASSWORD', null),
        'port' => env('REDIS_PORT', 6379),
        'database' => 0,
    ],

    'default' => [
        'host' => env('REDIS_HOST', '127.0.0.1'),
        'password' => env('REDIS_PASSWORD', null),
        'port' => env('REDIS_PORT', 6379),
        'database' => 10,
    ],

    'queue' => [
        'host' => env('REDIS_HOST', '127.0.0.1'),
        'password' => env('REDIS_PASSWORD', null),
        'port' => env('REDIS_PORT', 6379),
        'database' => 2,
    ],

    'sessions' => [
        'host' => env('REDIS_HOST', '127.0.0.1'),
        'password' => env('REDIS_PASSWORD', null),
        'port' => env('REDIS_PORT', 6379),
        'database' => 1,
    ],
],

// horizon.php
'environments' => [
    'production' => [
        'supervisor-1' => [
            'connection' => 'redis',
            'queue' => ['default'],
            'balance' => 'simple',
            'processes' => 10,
            'tries' => 3,
        ],
    ],

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

0 个答案:

没有答案