shoryuken 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ba8bef505d23849a92954c00b8e8e60682c884d44e0c23ca3fabbc9a4d5349a
4
- data.tar.gz: 7171d68f58db484f59b50eb53cb3a674801e690e9f6c394da9a2d7d79d82976a
3
+ metadata.gz: 177f42239f7942853a00ec1c527a63ef53662442e03c628f6b01f0a8a60f3c61
4
+ data.tar.gz: 6a6872a321ad6e300101905fbc08bc76dbcdc4a160d05eb8e061ae1972b2de67
5
5
  SHA512:
6
- metadata.gz: 865b059815b1e1462f4df2fb652bce2950b325a40366dc53b4a8c01c5492bfcf5687116ac4bf9e193d8235202117e8a8e7b99c0795ad7ae3c8637622bcd073a2
7
- data.tar.gz: 40c011460dc37ec522d5924010c1ab4c80f9db646fa835206aae726fc4d9ba05f86c72c98d661166262c63e1fe18ab9d02c4f945594d776fd5498ced1cf36fcc
6
+ metadata.gz: fcb645e36ec34051bcc588799dec40b3a7a0f69982c53ba8f9f309ebcf1db7c8b69d37f5c3765a9f7aa27ea710631fefa868241f253dc3a26400a77aa73a82fa
7
+ data.tar.gz: df7c1991c8e5370b4fe789ce2e0fa23c2270a12de6c40cf2ac5385e4587e5bc2259d90cb12c00a974bfc9bd7983ca7557927ad6c88e7bbd4fcf00481bc3b691d
@@ -0,0 +1,12 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: phstc
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: # Replace with a single Ko-fi username
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -1,3 +1,8 @@
1
+ ## [v5.0.2] - 2019-11-02
2
+
3
+ - Fix Queue order is reversed if passed through CLI
4
+ - [#571](https://github.com/phstc/shoryuken/pull/583)
5
+
1
6
  ## [v5.0.1] - 2019-06-19
2
7
 
3
8
  - Add back attr_accessor for `stop_callback`
@@ -20,7 +20,6 @@ module Shoryuken
20
20
  def setup_options
21
21
  initialize_options
22
22
  initialize_logger
23
- merge_cli_defined_queues
24
23
  end
25
24
 
26
25
  def load
@@ -76,17 +75,6 @@ module Shoryuken
76
75
  end
77
76
  end
78
77
 
79
- def merge_cli_defined_queues
80
- cli_defined_queues = options[:queues].to_a
81
-
82
- cli_defined_queues.each do |cli_defined_queue|
83
- # CLI defined queues override config_file defined queues
84
- Shoryuken.options[:queues].delete_if { |config_file_queue| config_file_queue[0] == cli_defined_queue[0] }
85
-
86
- Shoryuken.options[:queues] << cli_defined_queue
87
- end
88
- end
89
-
90
78
  def prefix_active_job_queue_name(queue_name, weight)
91
79
  queue_name_prefix = ::ActiveJob::Base.queue_name_prefix
92
80
  queue_name_delimiter = ::ActiveJob::Base.queue_name_delimiter
@@ -14,9 +14,11 @@ module Shoryuken
14
14
  }
15
15
  }.freeze
16
16
 
17
- attr_accessor :active_job_queue_name_prefixing, :cache_visibility_timeout, :default_worker_options, :groups,
18
- :launcher_executor, :sqs_client, :sqs_client_receive_message_opts,
17
+ attr_accessor :active_job_queue_name_prefixing, :cache_visibility_timeout, :groups,
18
+ :launcher_executor,
19
19
  :start_callback, :stop_callback, :worker_executor, :worker_registry
20
+ attr_writer :default_worker_options, :sqs_client
21
+ attr_reader :sqs_client_receive_message_opts
20
22
 
21
23
  def initialize
22
24
  self.groups = {}
@@ -1,3 +1,3 @@
1
1
  module Shoryuken
2
- VERSION = '5.0.1'.freeze
2
+ VERSION = '5.0.2'.freeze
3
3
  end
@@ -74,4 +74,28 @@ RSpec.describe Shoryuken::EnvironmentLoader do
74
74
  expect(Shoryuken.groups['group1'][:queues]).to eq(%w[test_group1_queue1 test_group1_queue2])
75
75
  end
76
76
  end
77
+ describe "#setup_options" do
78
+ let (:cli_queues) { { "queue1"=> 10, "queue2" => 20 } }
79
+ let (:config_queues) { [["queue1", 8], ["queue2", 4]] }
80
+ context "when given queues through config and CLI" do
81
+ specify do
82
+ allow_any_instance_of(Shoryuken::EnvironmentLoader).to receive(:config_file_options).and_return({ queues: config_queues })
83
+ Shoryuken::EnvironmentLoader.setup_options(queues: cli_queues)
84
+ expect(Shoryuken.options[:queues]).to eq(cli_queues)
85
+ end
86
+ end
87
+ context "when given queues through config only" do
88
+ specify do
89
+ allow_any_instance_of(Shoryuken::EnvironmentLoader).to receive(:config_file_options).and_return({ queues: config_queues })
90
+ Shoryuken::EnvironmentLoader.setup_options({})
91
+ expect(Shoryuken.options[:queues]).to eq(config_queues)
92
+ end
93
+ end
94
+ context "when given queues through CLI only" do
95
+ specify do
96
+ Shoryuken::EnvironmentLoader.setup_options(queues: cli_queues)
97
+ expect(Shoryuken.options[:queues]).to eq(cli_queues)
98
+ end
99
+ end
100
+ end
77
101
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoryuken
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Cantero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-19 00:00:00.000000000 Z
11
+ date: 2019-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv
@@ -117,6 +117,7 @@ extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
119
  - ".codeclimate.yml"
120
+ - ".github/FUNDING.yml"
120
121
  - ".gitignore"
121
122
  - ".rspec"
122
123
  - ".rubocop.yml"