{"id":19300039,"url":"https://github.com/kirschbaum-development/laravel-queue-batch-retry","last_synced_at":"2025-05-07T10:12:16.886Z","repository":{"id":48814446,"uuid":"276956202","full_name":"kirschbaum-development/laravel-queue-batch-retry","owner":"kirschbaum-development","description":"Package to retry failed jobs in batches using custom filters.","archived":false,"fork":false,"pushed_at":"2024-06-11T20:37:18.000Z","size":64,"stargazers_count":50,"open_issues_count":0,"forks_count":3,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-12-14T16:09:05.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kirschbaum-development.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-03T17:41:04.000Z","updated_at":"2024-06-11T20:37:06.000Z","dependencies_parsed_at":"2022-09-22T14:25:28.953Z","dependency_job_id":null,"html_url":"https://github.com/kirschbaum-development/laravel-queue-batch-retry","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirschbaum-development%2Flaravel-queue-batch-retry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirschbaum-development%2Flaravel-queue-batch-retry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirschbaum-development%2Flaravel-queue-batch-retry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirschbaum-development%2Flaravel-queue-batch-retry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kirschbaum-development","download_url":"https://codeload.github.com/kirschbaum-development/laravel-queue-batch-retry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231439065,"owners_count":18376836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T23:13:29.458Z","updated_at":"2024-12-27T05:06:19.678Z","avatar_url":"https://github.com/kirschbaum-development.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Queue Batch Retry\n\n![Laravel Supported Versions](https://img.shields.io/badge/laravel-6.x/7.x/8.x-green.svg)\n[![Actions Status](https://github.com/kirschbaum-development/laravel-queue-batch-retry/workflows/tests/badge.svg)](https://github.com/kirschbaum-development/laravel-queue-batch-retry/actions)\n[![MIT Licensed](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/kirschbaum-development/laravel-queue-batch-retry.svg?style=flat-square)](https://packagist.org/packages/kirschbaum-development/laravel-queue-batch-retry)\n[![Total Downloads](https://img.shields.io/packagist/dt/kirschbaum-development/laravel-queue-batch-retry.svg?style=flat-square)](https://packagist.org/packages/kirschbaum-development/laravel-queue-batch-retry)\n\nLaravel only allows you to retry one job per time or all of them when using the `queue:retry` command. This package gives you a few more options so you retry failed jobs in batches filtering to only the jobs you want.\n\n## Installation\n\nYou can install the package via composer:\n\n```console\ncomposer require kirschbaum-development/laravel-queue-batch-retry\n```\n\n## Usage\n\nThere's two different commands this package provides.\n\n### queue:failed:batch-retry\n\n```console\nphp artisan queue:failed:batch-retry --failed-after=\"2 days ago\" --queue=\"default\" --limit=10 --filter=\"CrawlWebsiteJob\" --filter-by-exception=\"ModelNotFoundException\"\n```\n\n**--filter**\n\nThe `failed_jobs` table is not really a structured table, so \"searching\" is basically a `like` condition on the `payload` condition. Using this option, depending on how many records you have, could be very slow since it will have to do a full table scan to find results. Hopefully, you don't have a lot of failed jobs, though.\n\n```console\nphp artisan queue:failed:batch-retry --filter=\"PublishDocumentJob\"\nphp artisan queue:failed:batch-retry --filter=\"12234\"\n```\n\n**--exclude-filter**\n\nThis is exact same as --filter, except in reverse. It will search all the payloads and exclude those given in the parameter.\n\n```console\nphp artisan queue:failed:batch-retry --exclude-filter=\"PublishDocumentJob\"\n```\n\n**--filter-by-exception**\n\nSame as the `--filter` option, but for the `exception` column in the `failed_jobs` table. Using this option, depending on how many records you have, could be very slow since it will have to do a full table scan to find results.\n\n```console\nphp artisan queue:failed:batch-retry --filter-by-exception=\"ModelNotFoundException\"\nphp artisan queue:failed:batch-retry --filter-by-exception=\"Error when creating directory\"\n```\n\n**--failed-after**\n\nThis option filters `failed_at` column. So let's say you had a bunch of jobs that failed today because of some API error in one of the services you use. You can retry all the jobs that failed since \"today\".\n\n```console\nphp artisan queue:failed:batch-retry --failed-after=\"today\"\n```\n\n**--failed-before**\n\nSame as the failed-after, but looking at previous dates.\n\n```console\nphp artisan queue:failed:batch-retry --failed-before=\"yesterday\"\n```\n\n**--limit**\n\nIn case you want to run in just a specific number of jobs.\n\n```console\nphp artisan queue:failed:batch-retry --limit=10\n```\n\n**--dry-run**\n\nWe always get afraid of screwing things up, right? You can run dry run the command and see what's going to be executed first.\n\n```console\nphp artisan queue:failed:batch-retry --dry-run\n```\n### queue:failed:batch-delete\n\nIn case you simply want to clean up your failed jobs table, there's also a `queue:failed:batch-delete` command which works exactly the same as the `queue:failed:batch-retry` command. You can use the same filters and options provided by the retry command.\n\n***\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email luis@kirschbaumdevelopment.com or nathan@kirschbaumdevelopment.com instead of using the issue tracker.\n\n## Credits\n\n- [Luis Dalmolin](https://github.com/luisdalmolin)\n\n## Sponsorship\n\nDevelopment of this package is sponsored by Kirschbaum Development Group, a developer driven company focused on problem solving, team building, and community. Learn more [about us](https://kirschbaumdevelopment.com) or [join us](https://kirschbaumdevelopment.com/careers)!\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirschbaum-development%2Flaravel-queue-batch-retry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkirschbaum-development%2Flaravel-queue-batch-retry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirschbaum-development%2Flaravel-queue-batch-retry/lists"}