hirefire-resource 0.7.5 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/README.md +3 -2
- data/hirefire-resource.gemspec +1 -1
- data/lib/hirefire-resource.rb +1 -2
- data/lib/hirefire/macro/good_job.rb +25 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf1b333fe0b454c20c681c25fcc71f0f848f241421ceedde11e30ba5f29a467f
|
4
|
+
data.tar.gz: 76cd10b7c38c130405db1988267cb861c9b0a4ca69a38b8e30404dbc92d576f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cab33d00cef820b5f895638e5b905c2ae30fcda10de6d890a168bfa4635643fdb6a2a074ebe1863476d8086c8615974dc0123e0b890e4dd147aea2c135107db7
|
7
|
+
data.tar.gz: df331cea509df6b7c1f58c8d65471479157dd4ce43179d5150b9cfe61144d2d9f1dd7da50cdd455ad28245dafbe748b671a1af72cdccf85846ce304ee25657d7
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -6,13 +6,14 @@ Load-based scaling, schedule-based scaling, dyno crash recovery, for [Heroku](ht
|
|
6
6
|
|
7
7
|
It supports practically any worker library. We provide out-of-the-box support for:
|
8
8
|
|
9
|
+
* Sidekiq
|
9
10
|
* Delayed Job
|
10
11
|
* Resque
|
12
|
+
* GoodJob
|
11
13
|
* Qu
|
14
|
+
* Que
|
12
15
|
* QueueClassic
|
13
|
-
* Sidekiq
|
14
16
|
* Bunny
|
15
|
-
* Que
|
16
17
|
|
17
18
|
*Note that you can write your own worker queue logic for almost any other worker library as well.
|
18
19
|
HireFire can scale multiple individual worker libraries at the same time, as well as multiple individual queues for any worker library.*
|
data/hirefire-resource.gemspec
CHANGED
data/lib/hirefire-resource.rb
CHANGED
@@ -6,9 +6,8 @@ HIREFIRE_PATH = File.expand_path("../hirefire", __FILE__)
|
|
6
6
|
require "#{HIREFIRE_PATH}/#{file}"
|
7
7
|
end
|
8
8
|
|
9
|
-
%w[delayed_job resque sidekiq qu qc bunny que].each do |file|
|
9
|
+
%w[delayed_job resque sidekiq qu qc bunny que good_job].each do |file|
|
10
10
|
require "#{HIREFIRE_PATH}/macro/#{file}"
|
11
11
|
end
|
12
12
|
|
13
13
|
require "#{HIREFIRE_PATH}/railtie" if defined?(Rails::Railtie)
|
14
|
-
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module HireFire
|
4
|
+
module Macro
|
5
|
+
module GoodJob
|
6
|
+
extend self
|
7
|
+
|
8
|
+
# Queries the PostgreSQL database through GoodJob in order to
|
9
|
+
# count the amount of jobs in the specified queue.
|
10
|
+
#
|
11
|
+
# @example Queue Macro Usage
|
12
|
+
# HireFire::Macro::GoodJob.queue # counts all queues.
|
13
|
+
# HireFire::Macro::GoodJob.queue("email") # counts the `email` queue.
|
14
|
+
#
|
15
|
+
# @param [String] queue the queue name to count. (default: nil # gets all queues)
|
16
|
+
# @return [Integer] the number of jobs in the queue(s).
|
17
|
+
#
|
18
|
+
def queue(*queues)
|
19
|
+
scope = ::GoodJob::Job.only_scheduled
|
20
|
+
scope = scope.where(queue_name: queues) if queues.any?
|
21
|
+
scope.count
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
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.
|
4
|
+
version: 0.8.0
|
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: 2020-
|
11
|
+
date: 2020-09-10 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
|
@@ -30,6 +30,7 @@ files:
|
|
30
30
|
- lib/hirefire/cli.rb
|
31
31
|
- lib/hirefire/macro/bunny.rb
|
32
32
|
- lib/hirefire/macro/delayed_job.rb
|
33
|
+
- lib/hirefire/macro/good_job.rb
|
33
34
|
- lib/hirefire/macro/qc.rb
|
34
35
|
- lib/hirefire/macro/qu.rb
|
35
36
|
- lib/hirefire/macro/que.rb
|