Got the table for queues?
Sep 8, 2017
14
Level 5
Delaying Jobs
Hey guys i want to delaying a job within my Controller. I migrated the jobs table on my sqlite connection and configured the queue driver to database. But no job was stored in the database. what am i doing wrong?
env
DB_CONNECTION=sqlite
QUEUE_DRIVER=database
queue conf
'database' => [
'driver' => 'database',
'connection' => 'sqlite',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
],
Controller
public function rotate()
{
OrderAndRegisterCerts::dispatch()->delay(Carbon::now()->addMinutes(3));
return DomainHandler::rotate();
}
Job
<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
class OrderAndRegisterCerts implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$a = 1+2;
echo $a;
}
}
Level 65
@webcodecs Yeah I guess it should still insert it even if it's 2hrs later. I've not used the database queue before. Have you tested with Redis?
Please or to participate in this conversation.