Skip to content

Instantly share code, notes, and snippets.

@derhansen
Last active November 10, 2022 17:17
Show Gist options
  • Select an option

  • Save derhansen/5709b8de3194566f5653 to your computer and use it in GitHub Desktop.

Select an option

Save derhansen/5709b8de3194566f5653 to your computer and use it in GitHub Desktop.
Laravel 5 - remove all jobs from a queue (redis driver)
Redis::connection()->del('queues:myqueue');
@andrewmclagan

Copy link
Copy Markdown

Wow this saved me....

@TheOnlyMerlin

Copy link
Copy Markdown

Saved me a bunch of frustration. Thanks!

@rodrigogalura

Copy link
Copy Markdown

how to implement this ? thank you

@fabiobranis

Copy link
Copy Markdown

@Rodz3rd2 you can use the tinker to run the command, so you won't need to implement this.

@gokigoks

gokigoks commented Mar 9, 2018

Copy link
Copy Markdown

Hi! how do I do one for beanstalkd?

@milosodalovic

Copy link
Copy Markdown

👍

@mkantautas

Copy link
Copy Markdown

del() expects an array, not string... @derhansen care to elaborate ?

@mattkomarnicki

Copy link
Copy Markdown

Hey @neorganic, just simply wrap the string in an array…

Redis::connection()->del([
    sprintf('queues:%s', $this->getQueueName()),
]);

however I see that passing a string works as well.

@Ravenna

Ravenna commented Mar 8, 2019

Copy link
Copy Markdown

Saved my cake!

@jackbaron

jackbaron commented Jan 27, 2021

Copy link
Copy Markdown

Hi all!
How to insert queue on redis.
Example: Redis::conection()->add([dataQueueInsert])
is there any way like that?

@wturrell

Copy link
Copy Markdown

Nowadays (Laravel 8, using artisan tinker):

use Illuminate\Support\Facades\Redis;
Redis::del('queues:myqueue');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment