-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40370 from eileencodes/granular-role-and-shard-sw…
…apping Implement granular role and shard swapping
- Loading branch information
Showing
34 changed files
with
3,164 additions
and
702 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
activerecord/lib/active_record/connection_adapters/legacy_pool_manager.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
module ActiveRecord | ||
module ConnectionAdapters | ||
class LegacyPoolManager # :nodoc: | ||
def initialize | ||
@name_to_pool_config = {} | ||
end | ||
|
||
def pool_configs(_ = nil) | ||
@name_to_pool_config.values | ||
end | ||
|
||
def remove_pool_config(_, shard) | ||
@name_to_pool_config.delete(shard) | ||
end | ||
|
||
def get_pool_config(_, shard) | ||
@name_to_pool_config[shard] | ||
end | ||
|
||
def set_pool_config(_, shard, pool_config) | ||
@name_to_pool_config[shard] = pool_config | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.