-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
Disable background worker when executing rake tasks #1509
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1509 +/- ##
==========================================
+ Coverage 98.21% 98.74% +0.52%
==========================================
Files 218 123 -95
Lines 10560 6761 -3799
==========================================
- Hits 10372 6676 -3696
+ Misses 188 85 -103 Continue to review full report at Codecov.
|
@st0012 Thanks for your quick fix! But, unfortunately, this can't fix my issue.
|
@y-yagi I see. I now see that the Rails rake task's initialization order is like this:
I'll dig into this more. |
@y-yagi I've updated the fix. It should work for both vanilla rake and Rails rake tasks. |
This helper temporarily disables background event dispatching when executing the block.
This makes sure all events, whether manually triggered or handled by the SDK, can be sent synchronously.
@st0012 Thanks! I confirmed this fixes my issue. |
@y-yagi sorry for the trouble and thanks for helping me verify the fix 🙂 |
@st0012 No problem! Thanks for your quick fix ❤️ |
@y-yagi fyi it's been released in version |
This fixes #1508
(I know disabling background worker by setting
background_worker_threads = 0
looks hacky, but I don't want to introduce another config option for background toggling atm.)