Skip to content

Commit

Permalink
Merge pull request resque#246 from lucasmundim/master
Browse files Browse the repository at this point in the history
Fix polling from /workers/all in resque-web
  • Loading branch information
defunkt committed May 16, 2011
2 parents c7a5244 + ae2828a commit 4373b5c
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 @@ -125,11 +125,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 @@ -146,14 +162,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 4373b5c

Please sign in to comment.