backburner-allq 1.0.46 → 1.0.48

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: 2bd17104136199c1837969e45bea3d40ffaa05e7be78c9e78e6538e183b5371d
4
- data.tar.gz: 1e71e0aeac0ccaf8696d6808074d79de6dc80052b64543a66169464609d94bdb
3
+ metadata.gz: 1cc1ca3dfb947978928b105c72d983339dad44979592aed6fd7915556475af4d
4
+ data.tar.gz: 1d4cad4b40e7d4cfec6b547f176f0e1764af4cabce2da280eebb54a075431ee2
5
5
  SHA512:
6
- metadata.gz: fad035b104c886a80812c775747a8d17007132eb37ac9838f759801a44fdd8e821710693331f0d5152d71c38c90f690667b75fcbffef6152a2d49d7226468bb7
7
- data.tar.gz: fccfb3743b106a1aea48baf4274edb52d436e2482b86d4d1aaa8988fcded262e7260cea2874aefaa43176f63650c294c4fdaf0f5267fe1d0c3c12136de6b3a8f
6
+ metadata.gz: 71847829e284ebc3765aeabcdf7ae87f4f21d6615ffc512ce072b96191ceeb8e1a5b7dbd86454796afd2b217b60513638aa5b617e8bf440cc2546642cf06b00c
7
+ data.tar.gz: e1a66316f5f301f3190b51a5a725026427b01bdd5178d0c7d74ddcfdb4f80d98c3d0adc91a935b429bf355a49b8f9cbf22cb16a809d1b4c07d07aed4fc3f88a9
data/deploy.sh CHANGED
@@ -1,3 +1,3 @@
1
1
  echo "Did you update the version?"
2
2
  gem build backburner-allq.gemspec
3
- gem push backburner-allq-1.0.46.gem
3
+ gem push backburner-allq-1.0.48.gem
@@ -28,7 +28,7 @@ module Backburner
28
28
 
29
29
  def self.load_environment(file = nil, environment = nil)
30
30
  file ||= "."
31
- if File.directory?(file) && File.exists?(File.expand_path("#{file}/config/environment.rb"))
31
+ if File.directory?(file) && File.exist?(File.expand_path("#{file}/config/environment.rb"))
32
32
  ENV["RAILS_ENV"] = environment if environment && ENV["RAILS_ENV"].nil?
33
33
  require "rails"
34
34
  require File.expand_path("#{file}/config/environment.rb")
@@ -40,7 +40,7 @@ module Backburner
40
40
  $rails_rake_task = false
41
41
  ::Rails::Initializer.run :load_application_classes
42
42
  end
43
- elsif File.directory?(file) && File.exists?(File.expand_path("#{file}/config/boot.rb"))
43
+ elsif File.directory?(file) && File.exist?(File.expand_path("#{file}/config/boot.rb"))
44
44
  ENV["RACK_ENV"] = environment if environment && ENV["RACK_ENV"].nil?
45
45
  ENV["PADRINO_ROOT"] = file
46
46
  require File.expand_path("#{file}/config/boot.rb")
@@ -1,3 +1,3 @@
1
1
  module Backburner
2
- VERSION = "1.0.46"
2
+ VERSION = "1.0.48"
3
3
  end
@@ -27,21 +27,25 @@ module Backburner
27
27
  # Backburner::Worker.enqueue NewsletterSender, [self.id, user.id], :ttr => 1000
28
28
  #
29
29
  def self.enqueue(job_class, args = [], opts = {})
30
+ options = opts.dup
31
+
30
32
  # Invoke Procs if they are sent
31
- opts.each_key do |k|
32
- opts[k] = opts[k].call job_class, args if opts[k].instance_of?(Proc)
33
+ options.each_key do |k|
34
+ if options[k].instance_of?(Proc)
35
+ options[k] = options[k].call job_class, args
36
+ end
33
37
  end
34
38
 
35
- opts[:shard_key] = opts[:shard_key].nil? ? 'X' : opts[:shard_key].to_s
36
- pri = resolve_priority(opts[:pri] || job_class)
37
- delay = [0, opts[:delay].to_i].max
38
- ttr = resolve_respond_timeout(opts[:ttr] || job_class)
39
+ options[:shard_key] = options[:shard_key].nil? ? 'X' : options[:shard_key].to_s
40
+ pri = resolve_priority(options[:pri] || job_class)
41
+ delay = [0, options[:delay].to_i].max
42
+ ttr = resolve_respond_timeout(options[:ttr] || job_class)
39
43
  res = Backburner::Hooks.invoke_hook_events(job_class, :before_enqueue, *args)
40
44
 
41
45
  return nil unless res # stop if hook is false
42
46
 
43
47
  data = { class: job_class.name, args: args, ttr: ttr }
44
- queue = opts[:queue] && (opts[:queue].is_a?(Proc) ? opts[:queue].call(job_class) : opts[:queue])
48
+ queue = options[:queue] && (options[:queue].is_a?(Proc) ? options[:queue].call(job_class) : options[:queue])
45
49
 
46
50
  begin
47
51
  response = nil
@@ -54,8 +58,8 @@ module Backburner
54
58
  delay: delay,
55
59
  ttr: ttr
56
60
  }
57
- opts.merge!(send_data)
58
- response = connection.put(tube_name, serialized_data, opts)
61
+ options.merge!(send_data)
62
+ response = connection.put(tube_name, serialized_data, options)
59
63
  end
60
64
  return nil unless Backburner::Hooks.invoke_hook_events(job_class, :after_enqueue, *args)
61
65
  ensure
data/lib/backburner.rb CHANGED
@@ -25,7 +25,7 @@ module Backburner
25
25
  # Backburner.enqueue NewsletterSender, self.id, user.id
26
26
  #
27
27
  def enqueue(job_class, args, opts={})
28
- opts[:shard_key] = opts[:shard_key].nil? ? "X" : opts[:shard_key].to_s
28
+ opts[:shard_key] = "X" if opts[:shard_key].nil?
29
29
  Backburner::Worker.enqueue(job_class, args, opts)
30
30
  end
31
31
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backburner-allq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.46
4
+ version: 1.0.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Malcolm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-04 00:00:00.000000000 Z
11
+ date: 2023-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: allq_rest