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

[5.x] Allow any queued class to be silenced #1241

Merged
merged 6 commits into from
Jan 25, 2023

Conversation

lioneaglesolutions
Copy link
Contributor

This PR looks bigger than it is due to moving a chunk of Fixtures and Unit tests into the Feature directory.

What problem does this solve?

This allows any queued class to be silenced - we have a lot of listeners that fire constantly and most of them are trivial so we don't need to see them in the completed list.

Related: #1239

This PR will allow any queued class to be silenced - the initial implementation meant only queued Jobs could be silenced. Now, any Mailable, Notification, Listener, Broadcast or Job can be silenced by implementing the Silenced interface.

The main changes to this PR are;

  • moving unit tests to feature directory so the config helper is useable in JobPayload
  • inspect the underlying job class to see if it has implemented the Silenced interface
  • move the logic to checking if the job is silenced from MarkJobAsComplete into the payload

I wasn't 100% sure on the silenced mailable test but did it the only way I could think to make it easy by adding the mock to the Horizon silenced config

@taylorotwell taylorotwell merged commit 80916ff into laravel:5.x Jan 25, 2023
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.

2 participants