Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear all jobs of one queue #328

Closed
tomswinkels opened this issue Apr 25, 2018 · 22 comments
Closed

Clear all jobs of one queue #328

tomswinkels opened this issue Apr 25, 2018 · 22 comments

Comments

@tomswinkels
Copy link
Contributor

Hi,

In beanstalk there is some button "Delete all ready jobs" is there in horizon also a button for that action?

@bryceadams
Copy link

You can create a command that executes code like:

use Redis;

Redis::connection()->del('queues:queue-name');

And it will clear that queue's jobs (which are ready/have not yet been run).

@mkantautas
Copy link

mkantautas commented May 24, 2018

Can you give a real life example ?because this doesn't seem to give me any effect.

Also dell seems to accept array type values not string.

Update: Solved my issue - turns out my redis connection is called 'horizon' . So Redis::connection('horizon')->del('queues:queue-name'): works as expected 👍

@tomswinkels
Copy link
Contributor Author

Yeah, but its better that i can do this in Horizon self! 👍

@mkantautas
Copy link

@tomswinkels Fully agree - that would be a great improvement !

@divdax
Copy link

divdax commented Aug 2, 2018

yup! would be cool to clear the queue via interface! +1

@tomswinkels
Copy link
Contributor Author

@taylorotwell :-) ?

@vmosoti
Copy link

vmosoti commented Sep 24, 2018

Try using this package: https://github.com/morrislaptop/laravel-queue-clear

@driesvints
Copy link
Member

I'll mark this as a feature request for now. Would be open to PRs which would implement this in a nice and clean way.

@mfn
Copy link
Contributor

mfn commented Oct 25, 2018

Ideally the functionality is available in Laravel but Horizon can expose an UI for that…

@dillingham
Copy link

Currently looking for this now
I have 90k jobs that are false due to a user clicking a import button too many times.

@ronlobo
Copy link

ronlobo commented Jan 22, 2019

@dillingham what a diligent user, clicking that button 90k times 😆

@dmitryuk
Copy link

dmitryuk commented Jul 8, 2019

@andreladocruz
Copy link

Any news about when this feature will be added to horizon???

@driesvints
Copy link
Member

@andreladocruz as soon as someone sends in a pr

@andreladocruz
Copy link

@neorganic, do you know how to run it in tinker?

@andreladocruz
Copy link

thanks...

do you know how to run the command

Redis::connection('horizon')->del('queues:queue-name')

in tinker?

@andreladocruz as soon as someone sends in a pr

@tomswinkels
Copy link
Contributor Author

@parkourben99 thnx for creating a pr :)

@driesvints
Copy link
Member

Since Taylor rejected the PR we're probably not going to implement this anytime soon, sorry. Anyone's free to do another attempt of the related PR which solves all the things that still need to be taken care of.

@rana01645
Copy link

rana01645 commented Apr 3, 2020

I'm using this command for clearing queue.

use Illuminate\Support\Facades\Redis;
Redis::connection()->del('queues:queue-name');

Unfortunately it's not removing delayed jobs.

Anyone have any clue about this.

Update:
This command removed my delayed jobs
Redis::connection()->del('queues:queue-name:delayed');

@garbinmarcelo
Copy link

I'm using this command for clearing queue.

use Illuminate\Support\Facades\Redis;
Redis::connection()->del('queues:queue-name');

Unfortunately it's not removing delayed jobs.

Anyone have any clue about this.

Update:
This command removed my delayed jobs
Redis::connection()->del('queues:queue-name:delayed');

Hi, does that remove the complete jobs too? I have the version of Laravel 7.
image

@sentiasa
Copy link

I had to give id explicitly like so:

\Redis::connection('horizon')->del('queues:my-queue:delayed', 39);

@marcosdsdba
Copy link

to cleaning all failed and completed :
Open redis-cli (my redis not using default port)
#redis-cli
127.0.0.1:6378> FLUSHDB

if u uses password:
127.0.0.1:6379> auth your_secret_here

after:
127.0.0.1:6378> FLUSHDB

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