Instead of storing the count of active workers as a heroku config
variable, I decided to create a table in our database to store the
value in.
So now I've got the problem narrowed down to the last line in the
method.  Here's the block of code I've now got:

add_heroku_worker
                heroku = Heroku::Client.new(ENV['HEROKU_USERNAME'],
ENV['HEROKU_PASSWORD'])
                myapp = heroku.config_vars(ENV['HEROKU_APP'])["HEROKU_APP"]
                worker_count = WorkerCount.find(1)  # now I'm storing the 
current
number of active workers in a table that will always only have one
record.
                workers = worker_count.workers
                qty = workers + 1
                worker_count.workers = qty
                worker_count.save
                heroku.set_workers(myapp, qty)
end

In the heroku console, this runs smoothly until I try the last line,
to which I get this error:  TypeError: can't convert
RestClient::Payload::UrlEncoded into String

This line is formatted the same as LostBoy's workless gem, the
autoscaling tree of delayed_job, and Heroku-Delayed-Job-Autoscale.  I
must be missing something obvious (typical newbie, huh?)   ;)

Thanks again for any help,
Jim

On Jan 20, 9:16 am, Peter Haza <[email protected]> wrote:
> I've done autoscaling of workers
> here:https://github.com/phaza/Heroku-Delayed-Job-Autoscale
> It's actually more like auto-shutdown of a single workers, but it works well
> in our environment.

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to