-
Notifications
You must be signed in to change notification settings - Fork 13
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
support nil logger #39
Conversation
@rx_adapter.send(:listener).send(:broadcast_messages) | ||
end | ||
|
||
assert true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No logger, nothing to check, just ensure it runs without errors
private | ||
def cable_config | ||
{ adapter: "solid_cable", message_retention: "1.second", | ||
polling_interval: "0.01.seconds" } | ||
polling_interval: "0.01.seconds", silence_polling: true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the default value, but needed to add it there for my mocking method with_active_record_logger
if ::SolidCable.silence_polling? | ||
ActiveRecord::Base.logger.silence { yield } | ||
if ::SolidCable.silence_polling? && ActiveRecord::Base.logger | ||
if ActiveRecord::Base.logger.respond_to?(:silence) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was getting an error, as silence is not present in rails application (7.2.1):
'with_polling_volume': undefined method `silence' for an instance of Logger (NoMethodError)
ActiveRecord::Base.logger.silence { yield }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this PR is merged i will do a PR to fix silence also for those who want to use solid_queue in earlier version that Rails 8
@npezza93 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
This feature has been implemented in solid_queue gem (rails/solid_queue#175)
I replicated the implementation for this gem.
FIxes rails/solid_cable/issues/38