Skip to content

Commit

Permalink
Fix "Worker doesn't exist" when using poll at /workers/all in resque-web
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmundim committed Mar 23, 2011
1 parent 246a082 commit ae2828a
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions lib/resque/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,27 @@ def show(page, layout = true)
erb :error, {:layout => false}, :error => "Can't connect to Redis! (#{Resque.redis_id})"
end
end

def show_for_polling(page)
content_type "text/html"
@polling = true
show(page.to_sym, false).gsub(/\s{1,}/, ' ')
end

# to make things easier on ourselves
get "/?" do
redirect url_path(:overview)
end

%w( overview workers ).each do |page|
get "/#{page}.poll" do
show_for_polling(page)
end

get "/#{page}/:id.poll" do
show_for_polling(page)
end
end

%w( overview queues working workers key ).each do |page|
get "/#{page}" do
Expand All @@ -145,14 +161,6 @@ def show(page, layout = true)
redirect u('queues')
end

%w( overview workers ).each do |page|
get "/#{page}.poll" do
content_type "text/html"
@polling = true
show(page.to_sym, false).gsub(/\s{1,}/, ' ')
end
end

get "/failed" do
if Resque::Failure.url
redirect Resque::Failure.url
Expand Down

0 comments on commit ae2828a

Please sign in to comment.