Skip to content

Commit 2b89531

Browse files
authored
Merge pull request #127 from a-h-abid/master
Add tip: Ignore Database when Job Fails
2 parents 128ae92 + 2092a41 commit 2b89531

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

other.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,3 +1508,18 @@ class CalculateSingleConsignment implements ShouldQueue
15081508

15091509
Tip given by [@pauloimon](https://github.com/pauloimon)
15101510

1511+
1512+
### Ignore Database when Job has failed
1513+
1514+
If you ever need to bypass database when a job fails, you can do one of the below things to skip database:
1515+
- Set env `QUEUE_FAILED_DRIVER` with value `null`. Works from Laravel 8 and above.
1516+
- Set the `failed` value to `null` in `config/queue.php` file, replacing the array (like below code). This one works for Laravel 7 and older.
1517+
1518+
```php
1519+
'failed' => null,
1520+
```
1521+
1522+
Why you would want this? For applications where you do not need to store failed jobs and they needs to have very high TPS, skipping database can be very favourable as we are not hitting database, saving times & prevent database going down.
1523+
1524+
Tip given by [@a-h-abid](https://github.com/a-h-abid)
1525+

0 commit comments

Comments
 (0)