Skip to content

Commit 65b2157

Browse files
committed
fix: support connection_pool v3
1 parent 4801998 commit 65b2157

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/react/server_rendering.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ module ServerRendering
1616
# @return [void]
1717
def self.reset_pool
1818
options = { size: pool_size, timeout: pool_timeout }
19-
@pool = ConnectionPool.new(options) { renderer.new(renderer_options) }
19+
20+
# ConnectionPool v3+ uses keyword arguments rather than positional
21+
@pool = if ConnectionPool::VERSION[0] <= "2"
22+
ConnectionPool.new(options) { renderer.new(renderer_options) }
23+
else
24+
ConnectionPool.new(**options) { renderer.new(renderer_options) }
25+
end
2026
end
2127

2228
# Check a renderer out of the pool and use it to render the component.

0 commit comments

Comments
 (0)