laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.54k stars 11.02k forks source link

Artisan command "queue:prune-failed" is not deleting any entries #44165

Closed FrancisMawn closed 2 years ago

FrancisMawn commented 2 years ago

Description:

Hi,

Not sure if it's a documentation issue or a code issue but running the artisan command queue:prune-failed will not delete any failed jobs that were created within the past 24 hours.

It seems a bit counter intuitive to have an optional argument altering the default behaviour of the command. The documentation states:

If you provide the --hours option to the command, only the failed job records that were inserted within the last N number of hours will be retained.

It does not mention that failed jobs are always kept for 24 hours by default, I had to dig through the code to figure that one out.

Steps To Reproduce:

  1. Create a failed job
  2. Run the artisan command queue:prune-failed.
  3. Output says: "0 entries deleted."
driesvints commented 2 years ago

https://laravel.com/docs/9.x/queues#pruning-failed-jobs

Screenshot 2022-09-19 at 09 57 40