Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
2  lib/hirefire/environment.rb
@@ -68,7 +68,7 @@ def environment
if environment = HireFire.configuration.environment
environment.to_s.camelize
else
- ENV.include?('HEROKU_UPID') ? 'Heroku' : 'Noop'
+ ::Rails.env.production? ? 'Heroku' : 'Noop'
end
).new
end
View
6 lib/hirefire/environment/heroku.rb
@@ -24,13 +24,15 @@ def workers(amount = nil)
# Returns the amount of Delayed Job
# workers that are currently running on Heroku
if amount.nil?
- return client.info(ENV['APP_NAME'])[:workers].to_i
+ #return client.info(ENV['APP_NAME'])[:workers].to_i
+ return client.ps(ENV['APP_NAME']).select {|p| p['process'] =~ /worker.[0-9]+/}.length
end
##
# Sets the amount of Delayed Job
# workers that need to be running on Heroku
- client.set_workers(ENV['APP_NAME'], amount)
+ #client.set_workers(ENV['APP_NAME'], amount)
+ return client.ps_scale(ENV['APP_NAME'], {"type" => "worker", "qty" => amount})
rescue RestClient::Exception
# Heroku library uses rest-client, currently, and it is quite
View
6 lib/hirefire/logger.rb
@@ -9,7 +9,7 @@ class Logger
# @param [String] string prints a string to the console (green color)
# @return [nil]
def self.message(string)
- puts loggify(string, :green)
+ puts loggify(string)
end
##
@@ -18,7 +18,7 @@ def self.message(string)
# @param [String] string prints a string to the console (red color)
# @return [nil]
def self.error(string)
- puts loggify(string, :red)
+ puts loggify(string)
end
##
@@ -27,7 +27,7 @@ def self.error(string)
# @param [String] string prints a string to the console (yellow color)
# @return [nil]
def self.warn(string)
- puts loggify(string, :yellow)
+ puts loggify(string)
end
##

No commit comments for this range

Something went wrong with that request. Please try again.