-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Correctly cache create_table_info #22547
Conversation
r? @chancancode (@rails-bot has picked a reviewer for you, use r? to override) |
8731c25
to
52b3a49
Compare
Follow up to #21664. |
Looks good to me :) def create_table_info_cache
@ create_table_info_cache ||= {}
end this hides how create_table_info works. And "Correctly cache create_table_info" is suitable to commit message I feel 👍 |
Follow up to rails#21664.
52b3a49
to
228ed57
Compare
@create_table_info_cache ||= {}
@yui-knk Thank you for your comment. I added |
The number of calling @rafaelfranca What do you think about it? |
@@ -1032,9 +1033,12 @@ def extract_foreign_key_action(structure, name, action) # :nodoc: | |||
end | |||
end | |||
|
|||
def create_table_info_cache # :nodoc: | |||
@create_table_info_cache ||= {} |
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.
Should not this be a Concurrent::Map
to avoid thread safety problems?
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.
Ah, it is only used in the schema dump, so we don't need to worry about thread-safety.
Correctly cache create_table_info
No description provided.