Skip to content
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

update #62

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/funding.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- 2.3
- 2.4
- 2.5
- 2.6
- 2.7
- "3.0"
- 3.1
- 3.2
Expand All @@ -35,16 +30,6 @@ jobs:
- "~> 4.x"
- "~> 5.x"
exclude:
- ruby-version: 2.3
resque-version: "~> 1.27"
- ruby-version: 2.5
resque-version: "~> 2.4.0"
- ruby-version: 2.5
resque-version: master
- ruby-version: 2.3
redis-version: "~> 5.x"
- ruby-version: 2.4
redis-version: "~> 5.x"
- resque-version: "~> 1.27"
redis-version: "~> 5.x"
env:
Expand Down
2 changes: 1 addition & 1 deletion resque-loner.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |s|

s.rubyforge_project = 'resque-loner'

s.add_runtime_dependency 'resque', '>= 1.27'
s.add_runtime_dependency 'resque', '>= 2.0'

%w(
airbrake
Expand Down
12 changes: 6 additions & 6 deletions test/worker_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,9 @@ def self.perform
end

test 'reconnects to redis after fork' do
original_connection = Resque.redis.client.connection.instance_variable_get('@sock')
original_connection = Resque.redis._client.connection.instance_variable_get('@sock')
@worker.work(0)
assert_not_equal original_connection, Resque.redis.client.connection.instance_variable_get('@sock')
assert_not_equal original_connection, Resque.redis._client.connection.instance_variable_get('@sock')
end

if !defined?(RUBY_ENGINE) || defined?(RUBY_ENGINE) && RUBY_ENGINE != 'jruby'
Expand All @@ -447,7 +447,7 @@ class LongRunningJob
@queue = :long_running_job

def self.perform(run_time, rescue_time = nil)
Resque.redis.client.reconnect # get its own connection
Resque.redis._client.reconnect # get its own connection
Resque.redis.rpush('sigterm-test:start', Process.pid)
sleep run_time
Resque.redis.rpush('sigterm-test:result', 'Finished Normally')
Expand All @@ -466,7 +466,7 @@ def self.perform(run_time, rescue_time = nil)
# ensure we actually fork
$TESTING = false
# reconnect since we just forked
Resque.redis.client.reconnect
Resque.redis._client.reconnect

worker = Resque::Worker.new(:long_running_job)

Expand Down Expand Up @@ -511,7 +511,7 @@ class LongRunningJob
@queue = :long_running_job

def self.perform(run_time, rescue_time = nil)
Resque.redis.client.reconnect # get its own connection
Resque.redis._client.reconnect # get its own connection
Resque.redis.rpush('sigterm-test:start', Process.pid)
sleep run_time
Resque.redis.rpush('sigterm-test:result', 'Finished Normally')
Expand All @@ -529,7 +529,7 @@ def self.perform(run_time, rescue_time = nil)
# ensure we actually fork
$TESTING = false
# reconnect since we just forked
Resque.redis.client.reconnect
Resque.redis._client.reconnect

worker = Resque::Worker.new(:long_running_job)
worker.term_timeout = 1
Expand Down
Loading