hirefire-resource 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +2 -2
- data/hirefire-resource.gemspec +12 -11
- data/lib/hirefire/macro/delayed_job.rb +14 -2
- metadata +26 -41
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9ea5be82aeeee6569948b72e4177ad2c0b98ce83
|
4
|
+
data.tar.gz: 698485c0b6dee6b181b139d31f36410f9e1b5047
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d82c5ffed1a4fbfe96fb43187acaa153b2d0884e4e714b0a42a920e7c8abf712dc25d9dafbe925baa2ab1d4d9d62e54cfe10f753d8478253e31768f6b7a8d6df
|
7
|
+
data.tar.gz: 50cd626f25602fa93efe6a62b4c6a7b77d98d615d7481df3f6660fb24e0fb1f260b06044d8285746b7a7db51310049cc8b9c4c4232081d38b4738f9668d3f83c
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [HireFire](http://hirefire.io/) -
|
1
|
+
# [HireFire](http://hirefire.io/) - Dyno management for Heroku
|
2
2
|
|
3
3
|
HireFire is a hosted service that manages / autoscales your [Heroku](http://heroku.com/) dynos.
|
4
4
|
|
@@ -44,7 +44,7 @@ HireFire::Resource.configure do |config|
|
|
44
44
|
end
|
45
45
|
|
46
46
|
config.dyno(:dj_worker) do
|
47
|
-
HireFire::Macro::Delayed::Job.queue
|
47
|
+
HireFire::Macro::Delayed::Job.queue(mapper: :active_record)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
```
|
data/hirefire-resource.gemspec
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
|
-
gem.name
|
5
|
-
gem.version
|
6
|
-
gem.platform
|
7
|
-
gem.authors
|
8
|
-
gem.email
|
9
|
-
gem.homepage
|
10
|
-
gem.summary
|
11
|
-
gem.description = "HireFire -
|
4
|
+
gem.name = "hirefire-resource"
|
5
|
+
gem.version = "0.2.3"
|
6
|
+
gem.platform = Gem::Platform::RUBY
|
7
|
+
gem.authors = "Michael van Rooijen"
|
8
|
+
gem.email = "michael@hirefire.io"
|
9
|
+
gem.homepage = "http://hirefire.io/"
|
10
|
+
gem.summary = "Dyno management for Heroku"
|
11
|
+
gem.description = "HireFire enables you to auto-scale your dynos, schedule capacity during specific times of the week, and recover crashed processes."
|
12
|
+
gem.licenses = ["Apache License"]
|
12
13
|
|
13
|
-
gem.files
|
14
|
-
gem.executables
|
15
|
-
gem.require_path
|
14
|
+
gem.files = %x[git ls-files].split("\n")
|
15
|
+
gem.executables = ["hirefire", "hirefireapp"]
|
16
|
+
gem.require_path = "lib"
|
16
17
|
end
|
17
18
|
|
@@ -22,6 +22,12 @@ module HireFire
|
|
22
22
|
# # "audio" and "video" queues with ActiveRecord mapper.
|
23
23
|
# HireFire::Macro::Delayed::Job.queue("audio", "video", :mapper => :active_record)
|
24
24
|
#
|
25
|
+
# # all queues with a maximum priority of 20
|
26
|
+
# HireFire::Macro::Delayed::Job.queue(:max_priority => 20, :mapper => :active_record)
|
27
|
+
#
|
28
|
+
# # all queues with a minimum priority of 5
|
29
|
+
# HireFire::Macro::Delayed::Job.queue(:min_priority => 5, :mapper => :active_record)
|
30
|
+
#
|
25
31
|
# @param [Array] queues provide one or more queue names, or none for "all".
|
26
32
|
# Last argument can pass in a Hash containing :mapper => :active_record or :mapper => :mongoid
|
27
33
|
# @return [Integer] the number of jobs in the queue(s).
|
@@ -40,17 +46,23 @@ module HireFire
|
|
40
46
|
c = ::Delayed::Job
|
41
47
|
c = c.where(:failed_at => nil)
|
42
48
|
c = c.where("run_at <= ?", Time.now.utc)
|
49
|
+
c = c.where("priority >= ?", options[:min_priority]) if options.key?(:min_priority)
|
50
|
+
c = c.where("priority <= ?", options[:max_priority]) if options.key?(:max_priority)
|
43
51
|
c = c.where(:queue => queues) unless queues.empty?
|
44
52
|
c.count
|
45
53
|
when :active_record_2
|
46
|
-
|
54
|
+
c = ::Delayed::Job
|
55
|
+
c = c.scoped(:conditions => ["run_at <= ? AND failed_at is NULL", Time.now.utc])
|
56
|
+
c = c.scoped(:conditions => ["priority >= ?", options[:min_priority]]) if options.key?(:min_priority)
|
57
|
+
c = c.scoped(:conditions => ["priority <= ?", options[:max_priority]]) if options.key?(:max_priority)
|
47
58
|
# There is no queue column in delayed_job <= 2.x
|
48
|
-
c = ::Delayed::Job.all(:conditions => conditions)
|
49
59
|
c.count
|
50
60
|
when :mongoid
|
51
61
|
c = ::Delayed::Job
|
52
62
|
c = c.where(:failed_at => nil)
|
53
63
|
c = c.where(:run_at.lte => Time.now.utc)
|
64
|
+
c = c.where(:priority.gte => options[:min_priority]) if options.key?(:min_priority)
|
65
|
+
c = c.where(:priority.lte => options[:max_priority]) if options.key?(:max_priority)
|
54
66
|
c = c.where(:queue.in => queues) unless queues.empty?
|
55
67
|
c.count
|
56
68
|
else
|
metadata
CHANGED
@@ -1,34 +1,25 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: hirefire-resource
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 0
|
7
|
-
- 2
|
8
|
-
- 2
|
9
|
-
version: 0.2.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.3
|
10
5
|
platform: ruby
|
11
|
-
authors:
|
6
|
+
authors:
|
12
7
|
- Michael van Rooijen
|
13
8
|
autorequire:
|
14
9
|
bindir: bin
|
15
10
|
cert_chain: []
|
16
|
-
|
17
|
-
date: 2013-09-26 00:00:00 +02:00
|
18
|
-
default_executable:
|
11
|
+
date: 2014-03-13 00:00:00.000000000 Z
|
19
12
|
dependencies: []
|
20
|
-
|
21
|
-
|
13
|
+
description: HireFire enables you to auto-scale your dynos, schedule capacity during
|
14
|
+
specific times of the week, and recover crashed processes.
|
22
15
|
email: michael@hirefire.io
|
23
|
-
executables:
|
16
|
+
executables:
|
24
17
|
- hirefire
|
25
18
|
- hirefireapp
|
26
19
|
extensions: []
|
27
|
-
|
28
20
|
extra_rdoc_files: []
|
29
|
-
|
30
|
-
|
31
|
-
- .gitignore
|
21
|
+
files:
|
22
|
+
- ".gitignore"
|
32
23
|
- LICENSE
|
33
24
|
- README.md
|
34
25
|
- bin/hirefire
|
@@ -44,35 +35,29 @@ files:
|
|
44
35
|
- lib/hirefire/middleware.rb
|
45
36
|
- lib/hirefire/railtie.rb
|
46
37
|
- lib/hirefire/resource.rb
|
47
|
-
has_rdoc: true
|
48
38
|
homepage: http://hirefire.io/
|
49
|
-
licenses:
|
50
|
-
|
39
|
+
licenses:
|
40
|
+
- Apache License
|
41
|
+
metadata: {}
|
51
42
|
post_install_message:
|
52
43
|
rdoc_options: []
|
53
|
-
|
54
|
-
require_paths:
|
44
|
+
require_paths:
|
55
45
|
- lib
|
56
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
46
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
58
48
|
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
65
53
|
- - ">="
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
|
68
|
-
- 0
|
69
|
-
version: "0"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
70
56
|
requirements: []
|
71
|
-
|
72
57
|
rubyforge_project:
|
73
|
-
rubygems_version:
|
58
|
+
rubygems_version: 2.2.2
|
74
59
|
signing_key:
|
75
|
-
specification_version:
|
76
|
-
summary:
|
60
|
+
specification_version: 4
|
61
|
+
summary: Dyno management for Heroku
|
77
62
|
test_files: []
|
78
|
-
|
63
|
+
has_rdoc:
|