File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -124,11 +124,27 @@ def show(page, layout = true)
124124 erb :error , { :layout => false } , :error => "Can't connect to Redis! (#{ Resque . redis_id } )"
125125 end
126126 end
127+
128+ def show_for_polling ( page )
129+ content_type "text/html"
130+ @polling = true
131+ show ( page . to_sym , false ) . gsub ( /\s {1,}/ , ' ' )
132+ end
127133
128134 # to make things easier on ourselves
129135 get "/?" do
130136 redirect url_path ( :overview )
131137 end
138+
139+ %w( overview workers ) . each do |page |
140+ get "/#{ page } .poll" do
141+ show_for_polling ( page )
142+ end
143+
144+ get "/#{ page } /:id.poll" do
145+ show_for_polling ( page )
146+ end
147+ end
132148
133149 %w( overview queues working workers key ) . each do |page |
134150 get "/#{ page } " do
@@ -145,14 +161,6 @@ def show(page, layout = true)
145161 redirect u ( 'queues' )
146162 end
147163
148- %w( overview workers ) . each do |page |
149- get "/#{ page } .poll" do
150- content_type "text/html"
151- @polling = true
152- show ( page . to_sym , false ) . gsub ( /\s {1,}/ , ' ' )
153- end
154- end
155-
156164 get "/failed" do
157165 if Resque ::Failure . url
158166 redirect Resque ::Failure . url
You can’t perform that action at this time.
0 commit comments