faktory_worker_ruby 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca8f1a3c8f94200639fe96c6ed6664ab02e3240a4176d73463cfd185bf0dd577
4
- data.tar.gz: c0a039afe5d4a3ca54d5c8ef779c282cd2266bce6665998c8da60d1829fa4cb2
3
+ metadata.gz: 8ba3a7a6dbf71b034a2e9a209830f3049132c72b12105262b6ce971df9e602e6
4
+ data.tar.gz: f0adb0757fdaed227ec36d13786dadf7a9e39b6854589f4c25e65a8c9101cf86
5
5
  SHA512:
6
- metadata.gz: 3ccf18cb61e1428fa6443c7f9862861d959bbf40d0914f94c8457642c97e72be367c5e3d019ae3a9cfc30f65dae22ad865b591892f6985a3a460d44dc442c378
7
- data.tar.gz: c9822086ef38bf740abd2a6b6afd099305e0d1998e0adcdefb6dbf5ccb84d7b4a6497ef22359320d13fef70899dfb7ebf29c361bd405ea7bb93eb41463719070
6
+ metadata.gz: 89471fb1dfd8624f9b562c773909378b4c40a4b52fd7dd198b7d2808199b2057a760b2cbcd919b8aa4494569979092c53762dd24e57be6ecfe7143a97540521d
7
+ data.tar.gz: 734b8145a57e435ecac307006723608998958bd9952a194c804fe033681579530d0ccc84ed591ffe8cfbbc5393abe4bd6b95045c49d02ceb3c87f742f6027905
@@ -0,0 +1,29 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ ruby: [2.5, 2.6, 2.7, '3.0']
15
+ runs-on: ubuntu-latest
16
+ services:
17
+ faktory:
18
+ image: contribsys/faktory:latest
19
+ ports:
20
+ - 7419:7419
21
+ - 7420:7420
22
+ steps:
23
+ - uses: actions/checkout@v2
24
+ - uses: ruby/setup-ruby@v1
25
+ with:
26
+ bundler-cache: true
27
+ ruby-version: ${{ matrix.ruby }}
28
+ - run: bundle install
29
+ - run: bundle exec rake
data/Changes.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 1.1.1
4
+
5
+ - Fix OpenSSL error [#59]
6
+
3
7
  ## 1.1.0
4
8
 
5
9
  - Send process RSS to Faktory for /Busy page
data/Gemfile.lock CHANGED
@@ -7,34 +7,35 @@ PATH
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activejob (6.0.3.2)
11
- activesupport (= 6.0.3.2)
10
+ activejob (6.1.3.2)
11
+ activesupport (= 6.1.3.2)
12
12
  globalid (>= 0.3.6)
13
- activesupport (6.0.3.2)
13
+ activesupport (6.1.3.2)
14
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
- i18n (>= 0.7, < 2)
16
- minitest (~> 5.1)
17
- tzinfo (~> 1.1)
18
- zeitwerk (~> 2.2, >= 2.2.2)
19
- concurrent-ruby (1.1.6)
20
- connection_pool (2.2.3)
21
- docile (1.3.2)
15
+ i18n (>= 1.6, < 2)
16
+ minitest (>= 5.1)
17
+ tzinfo (~> 2.0)
18
+ zeitwerk (~> 2.3)
19
+ concurrent-ruby (1.1.9)
20
+ connection_pool (2.2.5)
21
+ docile (1.4.0)
22
22
  globalid (0.4.2)
23
23
  activesupport (>= 4.2.0)
24
- i18n (1.8.5)
24
+ i18n (1.8.10)
25
25
  concurrent-ruby (~> 1.0)
26
- minitest (5.14.1)
26
+ minitest (5.14.4)
27
27
  minitest-hooks (1.5.0)
28
28
  minitest (> 5.3)
29
- rake (13.0.1)
30
- simplecov (0.18.5)
29
+ rake (13.0.3)
30
+ simplecov (0.21.2)
31
31
  docile (~> 1.1)
32
32
  simplecov-html (~> 0.11)
33
- simplecov-html (0.12.2)
34
- thread_safe (0.3.6)
35
- tzinfo (1.2.7)
36
- thread_safe (~> 0.1)
37
- zeitwerk (2.4.0)
33
+ simplecov_json_formatter (~> 0.1)
34
+ simplecov-html (0.12.3)
35
+ simplecov_json_formatter (0.1.3)
36
+ tzinfo (2.0.4)
37
+ concurrent-ruby (~> 1.0)
38
+ zeitwerk (2.4.2)
38
39
 
39
40
  PLATFORMS
40
41
  ruby
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # faktory\_worker\_ruby
2
2
 
3
- ![travis](https://travis-ci.org/contribsys/faktory_worker_ruby.svg?branch=master)
3
+ ![CI status](https://github.com/contribsys/faktory_worker_ruby/actions/workflows/ci.yml/badge.svg)
4
4
 
5
5
  Faktory\_worker\_ruby is the official Ruby client and worker process for the
6
6
  Faktory background job server. It is similar to [Sidekiq](http://sidekiq.org).
@@ -241,6 +241,7 @@ module Faktory
241
241
 
242
242
  def open(timeout = DEFAULT_TIMEOUT)
243
243
  if tls?
244
+ require 'openssl'
244
245
  sock = TCPSocket.new(@location.hostname, @location.port)
245
246
  sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true)
246
247
 
@@ -262,6 +263,7 @@ module Faktory
262
263
  "hostname": Socket.gethostname,
263
264
  "pid": $$,
264
265
  "labels": Faktory.options[:labels] || ["ruby-#{RUBY_VERSION}"],
266
+ "username": @location.user,
265
267
  "v": 2,
266
268
  }
267
269
 
data/lib/faktory/io.rb CHANGED
@@ -37,9 +37,9 @@ module Faktory
37
37
  loop do
38
38
  result = @sock.read_nonblock(nbytes, exception: false)
39
39
  if result == :wait_readable
40
- raise Faktory::TimeoutError unless @sock.wait_readable(@timeout)
40
+ raise Faktory::TimeoutError unless @sock.to_io.wait_readable(@timeout)
41
41
  elsif result == :wait_writable
42
- raise Faktory::TimeoutError unless @sock.wait_writeable(@timeout)
42
+ raise Faktory::TimeoutError unless @sock.to_io.wait_writeable(@timeout)
43
43
  elsif result == nil
44
44
  raise Errno::ECONNRESET
45
45
  else
data/lib/faktory/job.rb CHANGED
@@ -56,6 +56,11 @@ module Faktory
56
56
  @opts = opts
57
57
  end
58
58
 
59
+ def set(opts)
60
+ @opts = Util.deep_merge(@opts, opts)
61
+ self
62
+ end
63
+
59
64
  def perform_async(*args)
60
65
  client_push(@opts.merge('args'.freeze => args))
61
66
  end
@@ -104,7 +109,7 @@ module Faktory
104
109
  module ClassMethods
105
110
 
106
111
  def set(options)
107
- Setter.new(options.merge('jobtype'.freeze => self))
112
+ Setter.new(Util.deep_merge(get_faktory_options, options, 'jobtype'.freeze => self))
108
113
  end
109
114
 
110
115
  def perform_async(*args)
@@ -193,5 +198,23 @@ module Faktory
193
198
  end
194
199
 
195
200
  end
201
+
202
+ module Util
203
+ def deep_merge(*hashes)
204
+ initial = hashes.shift.transform_keys(&:to_s)
205
+ hashes.reduce(initial) do |acc, other_hash|
206
+ other_hash.transform_keys!(&:to_s)
207
+ acc.merge(other_hash) do |_key, this_val, other_val|
208
+ if this_val.is_a?(Hash) && other_val.is_a?(Hash)
209
+ deep_merge(this_val, other_val)
210
+ else
211
+ other_val
212
+ end
213
+ end
214
+ end
215
+ end
216
+ module_function :deep_merge
217
+ end
218
+
196
219
  end
197
220
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Faktory
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.1"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faktory_worker_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-03 00:00:00.000000000 Z
11
+ date: 2021-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -94,8 +94,8 @@ executables:
94
94
  extensions: []
95
95
  extra_rdoc_files: []
96
96
  files:
97
+ - ".github/workflows/ci.yml"
97
98
  - ".gitignore"
98
- - ".travis.yml"
99
99
  - Changes.md
100
100
  - Gemfile
101
101
  - Gemfile.lock
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- sudo: required
2
-
3
- language: ruby
4
-
5
- services:
6
- - docker
7
-
8
- before_install:
9
- - docker pull contribsys/faktory:latest
10
- - docker run -d -p 127.0.0.1:7419:7419 -p 127.0.0.1:7420:7420 contribsys/faktory:latest /faktory -b :7419 -w :7420
11
- - docker ps -a