lundi 13 janvier 2020

Jobs Not Queuing (E-Mails Sending Immediately)

I'm currently running into an issue where my e-mails are not queuing in Laravel 5.8.

I have run:

php artisan queue:table 
php artisan migrate
php artisan config:clear
php artisan config:cache

Controller:

$when = now()->addMinutes(2);

$customer->notify((new CustomerOrderItemStatusNotification($orderItem))->delay($when)); 

.env:

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=database
SESSION_DRIVER=file
SESSION_LIFETIME=120

queue.php:

'connections' => [
    'sync' => [
        'driver' => 'sync',
    ],

    'database' => [
        'driver' => 'database',
        'table' => 'jobs',
        'queue' => 'default',
        'retry_after' => 90,
    ]
]

CustomerOrderItemStatusNotification:

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;

class CustomerOrderItemStatusNotification extends Notification
{
    use Queueable;

The issue is that it is sending this immediately rather than waiting two minutes nor is it storing anything in the 'jobs' table.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire