Skip to content

Commit

Permalink
ajuste final
Browse files Browse the repository at this point in the history
  • Loading branch information
raulgomezn committed Nov 29, 2015
1 parent b71f403 commit 7a3173a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions app/controllers/hirefire_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ class HirefireController < ApplicationController

def info
puts 'Inicio Leer Cola HirefireController'

b = Bunny.new ENV['CLOUDAMQP_URL']
b.start # start a communication session with the amqp server

q = b.queue 'test1' # declare a queue

q.message_count
count = q.message_count.to_i
#puts count.to_i
b.stop # close the connection
b.close
puts "<---CLOSE cola HirefireController. " + q.message_count.to_s
puts "<---Cerrar cola hirefire HirefireController" + count.to_s

render json: JSON.generate([
{name: "worker", quantity: 0}
{name: "worker", quantity: count}
])
end

Expand Down
1 change: 0 additions & 1 deletion config/initializers/hirefire.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
HireFire::Resource.configure do |config|
config.dyno(:worker) do
#HireFire::Macro::Bunny.queue("test1", :connection => ENV['CLOUDAMQP_URL'])
puts 'Inicio Leer Cola hirefire'

b = Bunny.new ENV['CLOUDAMQP_URL']
Expand Down

0 comments on commit 7a3173a

Please sign in to comment.