Skip to content

Commit 955c64f

Browse files
committed
Support :name keyword arg for backwards compat, #210
1 parent 0dae4dd commit 955c64f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/connection_pool.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def self.wrap(**, &)
4545

4646
attr_reader :size
4747

48-
def initialize(timeout: 5, size: 5, auto_reload_after_fork: true, &)
48+
def initialize(timeout: 5, size: 5, auto_reload_after_fork: true, name: nil, &)
4949
raise ArgumentError, "Connection pool requires a block" unless block_given?
5050

5151
@size = Integer(size)

test/test_connection_pool.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ def test_shutdown_is_executed_for_all_connections
514514
end
515515

516516
def test_checkout_after_reload_cannot_create_new_connections_beyond_size
517-
pool = ConnectionPool.new(size: 1) { Object.new }
517+
pool = ConnectionPool.new(size: 1, name: "bob") { Object.new }
518518
threads = use_pool pool, 1
519519
pool.reload {}
520520
assert_raises ConnectionPool::TimeoutError do

0 commit comments

Comments
 (0)