hirefire-resource 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +2 -2
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +20 -17
- data/bin/rake +29 -0
- data/hirefire-resource.gemspec +1 -1
- data/lib/hirefire/macro/bunny.rb +2 -2
- data/lib/hirefire/macro/resque.rb +4 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a071158b508eb303b36e2e62e11ef4acfd104b4d3c2fb1431ce042587ce1c6e4
|
4
|
+
data.tar.gz: 8393b0eaf605fd706980506413d0424b5cf003d337e4930f8280cbf386602c22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e24741c9418227b9264499f9216af379f01f6036a8926ad0093f2412b09c83bafa0b276929d9388c9c05f08584c67714d39676b6675e4ae65b0b251f353884c5
|
7
|
+
data.tar.gz: 0fa7878f1f5c005928dbb26def63f11f0ad18b9bb425512eb6d37a922c407b05b5d81cfe651428c59be040c3f11b4c4b3f5df6057c4b1372b829f102a068114e
|
data/.github/workflows/main.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,42 +1,45 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hirefire-resource (0.
|
4
|
+
hirefire-resource (0.10.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
ast (2.4.2)
|
10
|
-
|
11
|
-
|
10
|
+
json (2.6.2)
|
11
|
+
parallel (1.22.1)
|
12
|
+
parser (3.1.2.1)
|
12
13
|
ast (~> 2.4.1)
|
13
|
-
rainbow (3.
|
14
|
+
rainbow (3.1.1)
|
14
15
|
rake (13.0.6)
|
15
|
-
regexp_parser (2.
|
16
|
+
regexp_parser (2.6.0)
|
16
17
|
rexml (3.2.5)
|
17
|
-
rubocop (1.
|
18
|
+
rubocop (1.35.1)
|
19
|
+
json (~> 2.3)
|
18
20
|
parallel (~> 1.10)
|
19
|
-
parser (>= 3.
|
21
|
+
parser (>= 3.1.2.1)
|
20
22
|
rainbow (>= 2.2.2, < 4.0)
|
21
23
|
regexp_parser (>= 1.8, < 3.0)
|
22
|
-
rexml
|
23
|
-
rubocop-ast (>= 1.
|
24
|
+
rexml (>= 3.2.5, < 4.0)
|
25
|
+
rubocop-ast (>= 1.20.1, < 2.0)
|
24
26
|
ruby-progressbar (~> 1.7)
|
25
27
|
unicode-display_width (>= 1.4.0, < 3.0)
|
26
|
-
rubocop-ast (1.
|
27
|
-
parser (>= 3.
|
28
|
-
rubocop-performance (1.
|
28
|
+
rubocop-ast (1.22.0)
|
29
|
+
parser (>= 3.1.1.0)
|
30
|
+
rubocop-performance (1.14.3)
|
29
31
|
rubocop (>= 1.7.0, < 2.0)
|
30
32
|
rubocop-ast (>= 0.4.0)
|
31
33
|
ruby-progressbar (1.11.0)
|
32
|
-
standard (1.
|
33
|
-
rubocop (= 1.
|
34
|
-
rubocop-performance (= 1.
|
35
|
-
standardrb (1.0.
|
34
|
+
standard (1.16.1)
|
35
|
+
rubocop (= 1.35.1)
|
36
|
+
rubocop-performance (= 1.14.3)
|
37
|
+
standardrb (1.0.1)
|
36
38
|
standard
|
37
|
-
unicode-display_width (2.
|
39
|
+
unicode-display_width (2.3.0)
|
38
40
|
|
39
41
|
PLATFORMS
|
42
|
+
arm64-darwin-21
|
40
43
|
x86_64-darwin-20
|
41
44
|
x86_64-linux
|
42
45
|
|
data/bin/rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rake' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rake", "rake")
|
data/hirefire-resource.gemspec
CHANGED
data/lib/hirefire/macro/bunny.rb
CHANGED
@@ -65,9 +65,9 @@ module HireFire
|
|
65
65
|
|
66
66
|
def count_messages(channel, queue_names, options)
|
67
67
|
queue_names.inject(0) do |sum, queue_name|
|
68
|
-
queue = if options.key?(:
|
68
|
+
queue = if options.key?(:"x-max-priority")
|
69
69
|
channel.queue(queue_name, durable: options[:durable],
|
70
|
-
|
70
|
+
arguments: {"x-max-priority" => options[:"x-max-priority"]})
|
71
71
|
else
|
72
72
|
channel.queue(queue_name, durable: options[:durable])
|
73
73
|
end
|
@@ -23,10 +23,12 @@ module HireFire
|
|
23
23
|
|
24
24
|
redis = ::Resque.redis
|
25
25
|
ids = Array(redis.smembers(:workers)).compact
|
26
|
-
raw_jobs = redis.pipelined
|
26
|
+
raw_jobs = redis.pipelined do |redis|
|
27
|
+
ids.map { |id| redis.get("worker:#{id}") }
|
28
|
+
end
|
27
29
|
jobs = raw_jobs.map { |raw_job| ::Resque.decode(raw_job) || {} }
|
28
30
|
|
29
|
-
in_queues = redis.pipelined do
|
31
|
+
in_queues = redis.pipelined do |redis|
|
30
32
|
queues.map { |queue| redis.llen("queue:#{queue}") }
|
31
33
|
end.map(&:to_i).inject(&:+)
|
32
34
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hirefire-resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael van Rooijen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Load- and schedule-based scaling for web- and worker dynos
|
14
14
|
email: michael@hirefire.io
|
@@ -24,6 +24,7 @@ files:
|
|
24
24
|
- LICENSE
|
25
25
|
- README.md
|
26
26
|
- Rakefile
|
27
|
+
- bin/rake
|
27
28
|
- hirefire-resource.gemspec
|
28
29
|
- lib/hirefire-resource.rb
|
29
30
|
- lib/hirefire/macro/bunny.rb
|
@@ -60,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
61
|
- !ruby/object:Gem::Version
|
61
62
|
version: '0'
|
62
63
|
requirements: []
|
63
|
-
rubygems_version: 3.
|
64
|
+
rubygems_version: 3.3.11
|
64
65
|
signing_key:
|
65
66
|
specification_version: 4
|
66
67
|
summary: Autoscaling for your Heroku dynos
|