Skip to content

Commit

Permalink
Fixed "pool_name" for Redis 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rykov committed Oct 29, 2023
1 parent 06af8fe commit ee398b1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,23 @@ on:
jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
ruby: [2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 3.0, head, jruby]
ruby: [2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, head, jruby]
redis: ["3.0", "4.0", "5.0"]

env:
REDIS_VERSION: "${{matrix.redis}}"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Ruby & run Bundler
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
rubygems: latest
- name: Run specs
run: bundle exec rake spec
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
source "https://rubygems.org"

REDIS_VERSION = ENV.fetch("REDIS_VERSION", '5.0').freeze

# Gemspec only lists command-line tool dependencies
gemspec

# Not-required for execution
group :development, :test do
gem 'redis', "~> #{REDIS_VERSION}"
gem 'rake', '>= 12.3.3'
gem 'rspec', '~> 3.0'
gem 'redis', '< 4.0'
end
end
4 changes: 3 additions & 1 deletion lib/pools/pooled.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ module Pooled

def initialize(*args)
options = args.extract_options!
pool_name = options.delete(:pool_name)

@preparation_chain = []
@connection_pool = ConnectionPool.new(self, options)
Pools.handler.add(@connection_pool, options[:pool_name])
Pools.handler.add(@connection_pool, pool_name)
end

def with_connection(&block)
Expand Down
2 changes: 1 addition & 1 deletion pools.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "pools"
s.version = "2.0.0"
s.version = "2.0.1"
s.date = Time.now.strftime('%Y-%m-%d')
s.summary = "Generalized connection pooling"
s.homepage = "http://github.com/rykov/pools"
Expand Down

0 comments on commit ee398b1

Please sign in to comment.