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

[3.x] Prevent 'memory exhausted' when deleting monitored tag #690

Merged

Conversation

gdebrauwer
Copy link
Contributor

Fixes #625.
Same PR as #682, but with test.

What?

When you monitor a tag and a lot of jobs are attached to tag, you will get a 'memory exhausted' php error when you remove the tag from monitoring list. This is caused by fetching all jobs of that tag in one query (in order to delete them all).

How?

Instead of fetching all jobs of the tag in one query, I used the paginate() method that is already present in TagRepository. By fetching and deleting small batches of jobs we will keep the php memory usage low at all times.

@taylorotwell taylorotwell merged commit 9fb28c2 into laravel:3.0 Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'Memory Exhausted' when removing monitored tag
2 participants