Skip to content

Instantly share code, notes, and snippets.

@Braunson
Created September 30, 2024 18:28
Show Gist options
  • Save Braunson/f1f2759d9205fa50387ab2878e9dd1d9 to your computer and use it in GitHub Desktop.
Save Braunson/f1f2759d9205fa50387ab2878e9dd1d9 to your computer and use it in GitHub Desktop.
Retry all (or a ton of) failed jobs in Laravel. If you want to use this in Laravel sail run this command inside your laravel.test container.
source .env
mysql -N --raw --batch \
-h"${DB_HOST}" -u"${DB_USERNAME}" -p"${DB_PASSWORD}" "${DB_DATABASE}" \
-e "SELECT uuid FROM failed_jobs ORDER BY id DESC LIMIT 100000" | \
xargs -P 4 -n 100 php /var/www/html/artisan queue:retry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment