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

Specify source of SolidQueue to ErrorReporter #447

Merged

Conversation

tmimura39
Copy link
Contributor

Currently, the default value application.active_support is applied for source. This does not identify it as an exception raised inside SolidQueue.

source: a String about the source of the error. The default source is "application". Errors reported by internal libraries may set other sources; the Redis cache library may use "redis_cache_store.active_support", for instance. Your subscriber can use the source to ignore errors you aren't interested in.

This is a quote from the rails guide.

Follow this guide to specify the source so that it can be determined that the error originated from inside SolidQueue.

Fixes #446

Currently, the default value `application.active_support` is applied for source.
This does not identify it as an exception raised inside SolidQueue.

> source: a String about the source of the error. The default source is "application". Errors reported by internal libraries may set other sources; the Redis cache library may use "redis_cache_store.active_support", for instance. Your subscriber can use the source to ignore errors you aren't interested in.

This is a quote from the [rails guide](https://github.com/rails/rails/blob/v8.0.0/guides/source/error_reporting.md?plain=1#L216-L220).

Follow this guide to specify the source so that it can be determined that the error originated from inside SolidQueue.

Fixes rails#446
@tmimura39 tmimura39 marked this pull request as ready for review December 9, 2024 07:52
@@ -4,7 +4,7 @@ module SolidQueue
module AppExecutor
def wrap_in_app_executor(&block)
if SolidQueue.app_executor
SolidQueue.app_executor.wrap(&block)
SolidQueue.app_executor.wrap(source: "application.solid_queue", &block)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

application.solid_queue

Not sure if these values are the best🙃

I followed the naming rules described here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems reasonable to me, reading that comment there 🤔

@rosa rosa merged commit 979dac1 into rails:main Dec 9, 2024
4 checks passed
@rosa
Copy link
Member

rosa commented Dec 9, 2024

This is great, thank you so much @tmimura39! 🙇‍♀️ 🙏

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.

Specify source of SolidQueue to ErrorReporter
2 participants