-
Notifications
You must be signed in to change notification settings - Fork 21
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
fix: Allow customizing the rake task regex to avoid starting the reporter #220
Changes from 2 commits
8f36030
92a34b9
ba932c2
c649d9c
e54cf5a
f4f9fd9
83ef97a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ def self.adapter_config | |
def initialize | ||
super | ||
|
||
log_msg = +"#{self.class.adapter_name} enabled" | ||
log_msg = "#{self.class.adapter_name} enabled" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like Ruby 2.x didn't like this change... it appears they consider interpolated strings as frozen, whereas 3+ doesn't: (which is probably why standard/rubocop suggested it?) % chruby 3.3.4
% ruby --enable-frozen-string-literal -e 'puts [RUBY_VERSION, "foo".frozen?, "#{%q(zomg)}".frozen?].inspect'
["3.3.4", true, false]
% chruby 2.7.8
% ruby --enable-frozen-string-literal -e 'puts [RUBY_VERSION, "foo".frozen?, "#{%q(zomg)}".frozen?].inspect'
["2.7.8", true, true]
I'm not sure I have a good suggestion that doesn't include a check on RUBY_VERSION to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Another approach here is to leave our code as it was before this PR, and lock our There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drafted a fix in #221. |
||
log_msg << " with busy job tracking support" if track_busy_jobs? | ||
logger.info log_msg | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ | |
Judoscale.configure do |config| | ||
# Open https://judoscale-adapter-mock.requestcatcher.com in a browser to monitor requests | ||
config.api_base_url = ENV["JUDOSCALE_URL"] || "https://judoscale-adapter-mock.requestcatcher.com" | ||
config.rake_task_ignore_regex = /assets:|db:|middleware/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it seem that "middleware" is default enough to warrant we skipping that by default as well? Or do you think we could run into some unexpected issue if we were to add it now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we'd run into any issues by including I don't think our default There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha, sounds good. |
||
# config.start_reporter_after_initialize = false | ||
end |
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.
This might be more Rails specific than Ruby specific, I guess, since it's only something we use there... maybe we should only expose it within Rails, like we have
start_reporter_after_initialize
?judoscale-ruby/judoscale-rails/lib/judoscale/rails/config.rb
Lines 4 to 6 in 92a34b9
(btw, it does make me wonder if we should have
config.rails.foo
like we have with the background workers, but that's probably another topic for discussion)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.
Good call! I'm moving this to be Rails-specific.