You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Client fails to receive updates in Rails console if Spring is enabled #73
So do I have to put some sort of conditional in there based on the environment? Because we don't run spring in production, just when running our test suites, so launchdarkly would never get initialized in those cases. So do I also start it via Puma as well?
LaunchDarklyInitializer = lambda do
LaunchDarkly::LDClient.new(...)
end
if defined?(Spring)
Spring.after_fork do
LaunchDarklyInitializer.call
end
else
LaunchDarklyInitializer.call
end
Activity
justinucd commentedon Nov 1, 2016
Update: To use LaunchDarkly with the Rails application preloader Spring, we recommend using an
after_forkcallback in the config/spring.rb file.Code example and documentation
robwise commentedon Jan 27, 2017
@justinucd If we are using both Spring and Puma with our Rails app, which method should we use (Puma after_boot or Spring after_fork)?
markedmondson commentedon Jan 27, 2017
@robwise you should be good in the
Spring#after_forkjustinucd commentedon Jan 27, 2017
Thanks @markedmondson ! @robwise let me know if this works for you - if not, we can look into it further
robwise commentedon Jan 27, 2017
So do I have to put some sort of conditional in there based on the environment? Because we don't run spring in production, just when running our test suites, so launchdarkly would never get initialized in those cases. So do I also start it via Puma as well?
markedmondson commentedon Jan 27, 2017
Semi-pseudo code:
Merge pull request #73 from launchdarkly/eb/ch19900/stream-error