I found a way to do this (For SQS):
$sqs_instance=Queue::getSqs();
$sqs_instance->delete($job_id);
I stumbled on this looking for a way to do this in Redis. For those in Redis See Edit 1 here. I was abale to remove all Queues by flushing Redis. FLUSHDB wil; "Delete all the keys of the currently selected DB."
$ redis-cli
127.0.0.1:6379> FLUSHDB
OK
127.0.0.1:6379> exit
the $job->delete()
method uses redis client zrem($listName, $job)
to delete the job from redis , in this case it may be :
$jobId = \Queue::push('DoTheJob', array('data'=>array(1,2,3)));
// Delete job
$this->redisDb->zrem("queue:sms_orders", $jobId); // redisDb from: Illuminate\Redis\Database
I made an artisan command which will clear all the jobs in your queue. You can optionally specify the connection and/or the pipe.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community