work_smarter 1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/README.markdown +1 -1
- data/lib/work_smarter.rb +2 -0
- data/work_smarter-1.0.gem +0 -0
- data/work_smarter.gemspec +2 -2
- metadata +4 -2
data/.gitignore
ADDED
data/README.markdown
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Work_smarter
|
2
2
|
|
3
|
-
Work_smarter is a simple wrapper for Delayed::Job that helps you autoscale workers when deployed on [Heroku](http://www.heroku.com).
|
3
|
+
Work_smarter is a simple wrapper for Delayed::Job that helps you autoscale workers when deployed on [Heroku](http://www.heroku.com).
|
4
4
|
|
5
5
|
__Please note:__ This is still very early days for Work_smarter, there's very little (read: zero) test coverage - and we've yet to even put it into production.
|
6
6
|
|
data/lib/work_smarter.rb
CHANGED
@@ -14,6 +14,7 @@ class Work_smarter < Struct.new(:obj, :func, :args)
|
|
14
14
|
# adds a heroku worker, if required
|
15
15
|
def enqueue(job)
|
16
16
|
if Rails.env == "production" && Delayed::Job.count == 0
|
17
|
+
require 'heroku-api'
|
17
18
|
heroku = Heroku::API.new(:api_key => @@config['api_key'])
|
18
19
|
heroku.post_ps_scale(@@config['application_name'], @@config['backgroundjob_name'], @@config['max_workers'])
|
19
20
|
end
|
@@ -22,6 +23,7 @@ class Work_smarter < Struct.new(:obj, :func, :args)
|
|
22
23
|
# removes heroku workers if queue is empty, or falling below max_workers
|
23
24
|
def after(job)
|
24
25
|
if Rails.env == "production" && Delayed::Job.count == 0
|
26
|
+
require 'heroku-api'
|
25
27
|
heroku = Heroku::API.new(:api_key => @@config['api_key'])
|
26
28
|
heroku.post_ps_scale(@@config['application_name'], @@config['backgroundjob_name'], @@config['min_workers'])
|
27
29
|
end
|
Binary file
|
data/work_smarter.gemspec
CHANGED
@@ -3,11 +3,11 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "work_smarter"
|
6
|
-
s.version = "1.0"
|
6
|
+
s.version = "1.0.1"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Deniz Okcu"]
|
9
9
|
s.email = ["deniz@combinio.com"]
|
10
|
-
s.homepage = "
|
10
|
+
s.homepage = "https://github.com/DenizOkcu/work_smarter"
|
11
11
|
s.summary = %q{work_smarter autoscales delayed_job workers on Heroku}
|
12
12
|
s.description = %q{work_smarter is a updated/modified version of the Komodo gem. It allows you to scale on-demand the number of delayed_job workers on Heroku, based on the length of your queue.}
|
13
13
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: work_smarter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -53,14 +53,16 @@ extensions: []
|
|
53
53
|
extra_rdoc_files: []
|
54
54
|
files:
|
55
55
|
- .DS_Store
|
56
|
+
- .gitignore
|
56
57
|
- Gemfile
|
57
58
|
- Gemfile.lock
|
58
59
|
- LICENSE
|
59
60
|
- README.markdown
|
60
61
|
- Rakefile
|
61
62
|
- lib/work_smarter.rb
|
63
|
+
- work_smarter-1.0.gem
|
62
64
|
- work_smarter.gemspec
|
63
|
-
homepage:
|
65
|
+
homepage: https://github.com/DenizOkcu/work_smarter
|
64
66
|
licenses: []
|
65
67
|
post_install_message:
|
66
68
|
rdoc_options: []
|