Русское сообщество разработки на PHP-фреймворке Laravel.
Ты не вошёл. Вход тут.
Страницы 1
Создавая очередь столкнулся с проблемой, задержка не срабатывает, письмо отправляется моментально..
Код самого файла очереди:
protected $email;
public function __construct($email)
{
$this->email = $email;
@Mail::to($email)->send(new Welcome);
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
info($this->email);
}
Код из контроллера:
@SendMessage::dispatch('xxx@gmail.com')->delay(now()->addMinutes(2));
return view('profile.profile');
Не в сети
вероятно(вангую), шта .env QUEUE_CONNECTION=sync, а не датабейз
Не в сети
Поддерживаю предыдущего оратора
There are two hard things in computer science: cache invalidation, naming things, and off-by-one errors.
Не в сети
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=database
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUR_DRIVER=database
Выставлено, однако задержки нет
Не в сети
th1scold, мы долго в угадайку играть будем?
Конфиг queue.php покажите
Не в сети
'default' => env('QUEUE_CONNECTION', 'database'),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
*/
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'retry_after' => 90,
'block_for' => 0,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', '[url]https://sqs.us-east-1.amazonaws.com/your-account-id[/url]'),
'queue' => env('SQS_QUEUE', 'your-queue-name'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90,
'block_for' => null,
],
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish.
|
*/
'failed' => [
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],
];
Не в сети
Страницы 1