resque_admin 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/HISTORY.md +30 -30
  3. data/README.markdown +83 -83
  4. data/bin/resque +5 -5
  5. data/bin/resque-web +4 -4
  6. data/lib/resque_admin/data_store.rb +4 -4
  7. data/lib/resque_admin/errors.rb +1 -1
  8. data/lib/resque_admin/failure/airbrake.rb +4 -4
  9. data/lib/resque_admin/failure/base.rb +1 -1
  10. data/lib/resque_admin/failure/multiple.rb +2 -2
  11. data/lib/resque_admin/failure/redis.rb +7 -7
  12. data/lib/resque_admin/failure/redis_multi_queue.rb +11 -11
  13. data/lib/resque_admin/failure.rb +6 -6
  14. data/lib/resque_admin/helpers.rb +9 -9
  15. data/lib/resque_admin/job.rb +22 -22
  16. data/lib/resque_admin/log_formatters/quiet_formatter.rb +1 -1
  17. data/lib/resque_admin/log_formatters/verbose_formatter.rb +1 -1
  18. data/lib/resque_admin/log_formatters/very_verbose_formatter.rb +1 -1
  19. data/lib/resque_admin/logging.rb +2 -2
  20. data/lib/resque_admin/plugin.rb +2 -2
  21. data/lib/resque_admin/server/helpers.rb +4 -4
  22. data/lib/resque_admin/server/test_helper.rb +2 -2
  23. data/lib/resque_admin/server/views/failed.erb +2 -2
  24. data/lib/resque_admin/server/views/failed_queues_overview.erb +3 -3
  25. data/lib/resque_admin/server/views/layout.erb +6 -6
  26. data/lib/resque_admin/server/views/queues.erb +5 -5
  27. data/lib/resque_admin/server/views/stats.erb +1 -1
  28. data/lib/resque_admin/server/views/workers.erb +4 -4
  29. data/lib/resque_admin/server/views/working.erb +1 -1
  30. data/lib/resque_admin/server.rb +35 -35
  31. data/lib/resque_admin/stat.rb +2 -2
  32. data/lib/resque_admin/tasks.rb +8 -8
  33. data/lib/resque_admin/thread_signal.rb +1 -1
  34. data/lib/resque_admin/version.rb +2 -2
  35. data/lib/resque_admin/worker.rb +29 -29
  36. data/lib/resque_admin.rb +27 -27
  37. metadata +4 -4
@@ -1,4 +1,4 @@
1
- module Resque
1
+ module ResqueAdmin
2
2
  module Failure
3
3
  # All Failure classes are expected to subclass Base.
4
4
  #
@@ -1,4 +1,4 @@
1
- module Resque
1
+ module ResqueAdmin
2
2
  module Failure
3
3
  # A Failure backend that uses multiple backends
4
4
  # delegates all queries to the first backend
@@ -10,7 +10,7 @@ module Resque
10
10
 
11
11
  def self.configure
12
12
  yield self
13
- Resque::Failure.backend = self
13
+ ResqueAdmin::Failure.backend = self
14
14
  end
15
15
 
16
16
  def initialize(*args)
@@ -1,15 +1,15 @@
1
- module Resque
1
+ module ResqueAdmin
2
2
  module Failure
3
3
  # A Failure backend that stores exceptions in Redis. Very simple but
4
- # works out of the box, along with support in the Resque web app.
4
+ # works out of the box, along with support in the ResqueAdmin web app.
5
5
  class Redis < Base
6
6
 
7
7
  def data_store
8
- Resque.data_store
8
+ ResqueAdmin.data_store
9
9
  end
10
10
 
11
11
  def self.data_store
12
- Resque.data_store
12
+ ResqueAdmin.data_store
13
13
  end
14
14
 
15
15
  def save
@@ -22,7 +22,7 @@ module Resque
22
22
  :worker => worker.to_s,
23
23
  :queue => queue
24
24
  }
25
- data = Resque.encode(data)
25
+ data = ResqueAdmin.encode(data)
26
26
  data_store.push_to_failed_queue(data)
27
27
  end
28
28
 
@@ -44,7 +44,7 @@ module Resque
44
44
 
45
45
  def self.all(offset = 0, limit = 1, queue = nil)
46
46
  check_queue(queue)
47
- Resque.list_range(:failed, offset, limit)
47
+ ResqueAdmin.list_range(:failed, offset, limit)
48
48
  end
49
49
 
50
50
  def self.each(offset = 0, limit = self.count, queue = :failed, class_name = nil, order = 'desc')
@@ -79,7 +79,7 @@ module Resque
79
79
  check_queue(queue)
80
80
  item = all(id)
81
81
  item['retried_at'] = Time.now.strftime("%Y/%m/%d %H:%M:%S")
82
- data_store.update_item_in_failed_queue(id,Resque.encode(item))
82
+ data_store.update_item_in_failed_queue(id,ResqueAdmin.encode(item))
83
83
  Job.create(item['queue'], item['payload']['class'], *item['payload']['args'])
84
84
  end
85
85
 
@@ -1,15 +1,15 @@
1
- module Resque
1
+ module ResqueAdmin
2
2
  module Failure
3
3
  # A Failure backend that stores exceptions in Redis. Very simple but
4
- # works out of the box, along with support in the Resque web app.
4
+ # works out of the box, along with support in the ResqueAdmin web app.
5
5
  class RedisMultiQueue < Base
6
6
 
7
7
  def data_store
8
- Resque.data_store
8
+ ResqueAdmin.data_store
9
9
  end
10
10
 
11
11
  def self.data_store
12
- Resque.data_store
12
+ ResqueAdmin.data_store
13
13
  end
14
14
 
15
15
  def save
@@ -22,8 +22,8 @@ module Resque
22
22
  :worker => worker.to_s,
23
23
  :queue => queue
24
24
  }
25
- data = Resque.encode(data)
26
- data_store.push_to_failed_queue(data,Resque::Failure.failure_queue_name(queue))
25
+ data = ResqueAdmin.encode(data)
26
+ data_store.push_to_failed_queue(data,ResqueAdmin::Failure.failure_queue_name(queue))
27
27
  end
28
28
 
29
29
  def self.count(queue = nil, class_name = nil)
@@ -43,7 +43,7 @@ module Resque
43
43
  end
44
44
 
45
45
  def self.all(offset = 0, limit = 1, queue = :failed)
46
- Resque.list_range(queue, offset, limit)
46
+ ResqueAdmin.list_range(queue, offset, limit)
47
47
  end
48
48
 
49
49
  def self.queues
@@ -74,7 +74,7 @@ module Resque
74
74
  def self.requeue(id, queue = :failed)
75
75
  item = all(id, 1, queue)
76
76
  item['retried_at'] = Time.now.strftime("%Y/%m/%d %H:%M:%S")
77
- data_store.update_item_in_failed_queue(id,Resque.encode(item),queue)
77
+ data_store.update_item_in_failed_queue(id,ResqueAdmin.encode(item),queue)
78
78
  Job.create(item['queue'], item['payload']['class'], *item['payload']['args'])
79
79
  end
80
80
 
@@ -83,16 +83,16 @@ module Resque
83
83
  end
84
84
 
85
85
  def self.requeue_queue(queue)
86
- failure_queue = Resque::Failure.failure_queue_name(queue)
86
+ failure_queue = ResqueAdmin::Failure.failure_queue_name(queue)
87
87
  each(0, count(failure_queue), failure_queue) { |id, _| requeue(id, failure_queue) }
88
88
  end
89
89
 
90
90
  def self.requeue_all
91
- queues.each { |queue| requeue_queue(Resque::Failure.job_queue_name(queue)) }
91
+ queues.each { |queue| requeue_queue(ResqueAdmin::Failure.job_queue_name(queue)) }
92
92
  end
93
93
 
94
94
  def self.remove_queue(queue)
95
- data_store.remove_failed_queue(Resque::Failure.failure_queue_name(queue))
95
+ data_store.remove_failed_queue(ResqueAdmin::Failure.failure_queue_name(queue))
96
96
  end
97
97
 
98
98
  def filter_backtrace(backtrace)
@@ -1,9 +1,9 @@
1
- module Resque
1
+ module ResqueAdmin
2
2
  # The Failure module provides an interface for working with different
3
3
  # failure backends.
4
4
  #
5
5
  # You can use it to query the failure backend without knowing which specific
6
- # backend is being used. For instance, the Resque web app uses it to display
6
+ # backend is being used. For instance, the ResqueAdmin web app uses it to display
7
7
  # stats and other information.
8
8
  module Failure
9
9
  # Creates a new failure, which is delegated to the appropriate backend.
@@ -19,17 +19,17 @@ module Resque
19
19
 
20
20
  #
21
21
  # Sets the current backend. Expects a class descendent of
22
- # `Resque::Failure::Base`.
22
+ # `ResqueAdmin::Failure::Base`.
23
23
  #
24
24
  # Example use:
25
25
  # require 'resque_admin/failure/airbrake'
26
- # Resque::Failure.backend = Resque::Failure::Airbrake
26
+ # ResqueAdmin::Failure.backend = ResqueAdmin::Failure::Airbrake
27
27
  def self.backend=(backend)
28
28
  @backend = backend
29
29
  end
30
30
 
31
31
  # Returns the current backend class. If none has been set, falls
32
- # back to `Resque::Failure::Redis`
32
+ # back to `ResqueAdmin::Failure::Redis`
33
33
  def self.backend
34
34
  return @backend if @backend
35
35
 
@@ -48,7 +48,7 @@ module Resque
48
48
  # Obtain the failure queue name for a given job queue
49
49
  def self.failure_queue_name(job_queue_name)
50
50
  name = "#{job_queue_name}_failed"
51
- Resque.data_store.add_failed_queue(name)
51
+ ResqueAdmin.data_store.add_failed_queue(name)
52
52
  name
53
53
  end
54
54
 
@@ -8,41 +8,41 @@ elsif MultiJson.respond_to?(:engine)
8
8
  raise "Please install the yajl-ruby or json gem" if MultiJson.engine.to_s == 'MultiJson::Engines::OkJson'
9
9
  end
10
10
 
11
- module Resque
12
- # Methods used by various classes in Resque.
11
+ module ResqueAdmin
12
+ # Methods used by various classes in ResqueAdmin.
13
13
  module Helpers
14
14
  class DecodeException < StandardError; end
15
15
 
16
16
  # Direct access to the Redis instance.
17
17
  def redis
18
18
  # No infinite recursions, please.
19
- # Some external libraries depend on Resque::Helpers being mixed into
20
- # Resque, but this method causes recursions. If we have a super method,
19
+ # Some external libraries depend on ResqueAdmin::Helpers being mixed into
20
+ # ResqueAdmin, but this method causes recursions. If we have a super method,
21
21
  # assume it is canonical. (see #1150)
22
22
  return super if defined?(super)
23
23
 
24
- Resque.redis
24
+ ResqueAdmin.redis
25
25
  end
26
26
 
27
27
  # Given a Ruby object, returns a string suitable for storage in a
28
28
  # queue.
29
29
  def encode(object)
30
- Resque.encode(object)
30
+ ResqueAdmin.encode(object)
31
31
  end
32
32
 
33
33
  # Given a string, returns a Ruby object.
34
34
  def decode(object)
35
- Resque.decode(object)
35
+ ResqueAdmin.decode(object)
36
36
  end
37
37
 
38
38
  # Given a word with dashes, returns a camel cased version of it.
39
39
  def classify(dashed_word)
40
- Resque.classify(dashed_word)
40
+ ResqueAdmin.classify(dashed_word)
41
41
  end
42
42
 
43
43
  # Tries to find a constant with the name specified in the argument string
44
44
  def constantize(camel_cased_word)
45
- Resque.constantize(camel_cased_word)
45
+ ResqueAdmin.constantize(camel_cased_word)
46
46
  end
47
47
  end
48
48
  end
@@ -1,5 +1,5 @@
1
- module Resque
2
- # A Resque::Job represents a unit of work. Each job lives on a
1
+ module ResqueAdmin
2
+ # A ResqueAdmin::Job represents a unit of work. Each job lives on a
3
3
  # single queue and has an associated payload object. The payload
4
4
  # is a hash with two attributes: `class` and `args`. The `class` is
5
5
  # the name of the Ruby class which should be used to run the
@@ -8,19 +8,19 @@ module Resque
8
8
  #
9
9
  # You can manually run a job using this code:
10
10
  #
11
- # job = Resque::Job.reserve(:high)
12
- # klass = Resque::Job.constantize(job.payload['class'])
11
+ # job = ResqueAdmin::Job.reserve(:high)
12
+ # klass = ResqueAdmin::Job.constantize(job.payload['class'])
13
13
  # klass.perform(*job.payload['args'])
14
14
  class Job
15
15
  include Helpers
16
16
  extend Helpers
17
17
  def redis
18
- Resque.redis
18
+ ResqueAdmin.redis
19
19
  end
20
20
  alias :data_store :redis
21
21
 
22
22
  def self.redis
23
- Resque.redis
23
+ ResqueAdmin.redis
24
24
  end
25
25
 
26
26
  def self.data_store
@@ -30,36 +30,36 @@ module Resque
30
30
  # Given a Ruby object, returns a string suitable for storage in a
31
31
  # queue.
32
32
  def encode(object)
33
- Resque.encode(object)
33
+ ResqueAdmin.encode(object)
34
34
  end
35
35
 
36
36
  # Given a string, returns a Ruby object.
37
37
  def decode(object)
38
- Resque.decode(object)
38
+ ResqueAdmin.decode(object)
39
39
  end
40
40
 
41
41
  # Given a Ruby object, returns a string suitable for storage in a
42
42
  # queue.
43
43
  def self.encode(object)
44
- Resque.encode(object)
44
+ ResqueAdmin.encode(object)
45
45
  end
46
46
 
47
47
  # Given a string, returns a Ruby object.
48
48
  def self.decode(object)
49
- Resque.decode(object)
49
+ ResqueAdmin.decode(object)
50
50
  end
51
51
 
52
52
  # Given a word with dashes, returns a camel cased version of it.
53
53
  def classify(dashed_word)
54
- Resque.classify(dashed_word)
54
+ ResqueAdmin.classify(dashed_word)
55
55
  end
56
56
 
57
57
  # Tries to find a constant with the name specified in the argument string
58
58
  def constantize(camel_cased_word)
59
- Resque.constantize(camel_cased_word)
59
+ ResqueAdmin.constantize(camel_cased_word)
60
60
  end
61
61
 
62
- # Raise Resque::Job::DontPerform from a before_perform hook to
62
+ # Raise ResqueAdmin::Job::DontPerform from a before_perform hook to
63
63
  # abort the job.
64
64
  DontPerform = Class.new(StandardError)
65
65
 
@@ -85,14 +85,14 @@ module Resque
85
85
  #
86
86
  # Raises an exception if no queue or class is given.
87
87
  def self.create(queue, klass, *args)
88
- Resque.validate(klass, queue)
88
+ ResqueAdmin.validate(klass, queue)
89
89
 
90
- if Resque.inline?
91
- # Instantiating a Resque::Job and calling perform on it so callbacks run
90
+ if ResqueAdmin.inline?
91
+ # Instantiating a ResqueAdmin::Job and calling perform on it so callbacks run
92
92
  # decode(encode(args)) to ensure that args are normalized in the same manner as a non-inline job
93
93
  new(:inline, {'class' => klass, 'args' => decode(encode(args))}).perform
94
94
  else
95
- Resque.push(queue, :class => klass.to_s, :args => args)
95
+ ResqueAdmin.push(queue, :class => klass.to_s, :args => args)
96
96
  end
97
97
  end
98
98
 
@@ -111,11 +111,11 @@ module Resque
111
111
  #
112
112
  # The following call will remove both:
113
113
  #
114
- # Resque::Job.destroy(queue, 'UpdateGraph')
114
+ # ResqueAdmin::Job.destroy(queue, 'UpdateGraph')
115
115
  #
116
116
  # Whereas specifying args will only remove the 2nd job:
117
117
  #
118
- # Resque::Job.destroy(queue, 'UpdateGraph', 'mojombo')
118
+ # ResqueAdmin::Job.destroy(queue, 'UpdateGraph', 'mojombo')
119
119
  #
120
120
  # This method can be potentially very slow and memory intensive,
121
121
  # depending on the size of your queue, as it loads all jobs into
@@ -137,10 +137,10 @@ module Resque
137
137
  destroyed
138
138
  end
139
139
 
140
- # Given a string queue name, returns an instance of Resque::Job
140
+ # Given a string queue name, returns an instance of ResqueAdmin::Job
141
141
  # if any jobs are available. If not, returns nil.
142
142
  def self.reserve(queue)
143
- return unless payload = Resque.pop(queue)
143
+ return unless payload = ResqueAdmin.pop(queue)
144
144
  new(queue, payload)
145
145
  end
146
146
 
@@ -154,7 +154,7 @@ module Resque
154
154
 
155
155
  begin
156
156
  # Execute before_perform hook. Abort the job gracefully if
157
- # Resque::DontPerform is raised.
157
+ # ResqueAdmin::DontPerform is raised.
158
158
  begin
159
159
  before_hooks.each do |hook|
160
160
  job.send(hook, *job_args)
@@ -1,4 +1,4 @@
1
- module Resque
1
+ module ResqueAdmin
2
2
  class QuietFormatter
3
3
  def call(serverity, datetime, progname, msg)
4
4
  ""
@@ -1,4 +1,4 @@
1
- module Resque
1
+ module ResqueAdmin
2
2
  class VerboseFormatter
3
3
  def call(serverity, datetime, progname, msg)
4
4
  "*** #{msg}\n"
@@ -1,4 +1,4 @@
1
- module Resque
1
+ module ResqueAdmin
2
2
  class VeryVerboseFormatter
3
3
  def call(serverity, datetime, progname, msg)
4
4
  time = Time.now.strftime('%H:%M:%S %Y-%m-%d')
@@ -1,11 +1,11 @@
1
- module Resque
1
+ module ResqueAdmin
2
2
  # Include this module in classes you wish to have logging facilities
3
3
  module Logging
4
4
  module_function
5
5
 
6
6
  # Thunk to the logger's own log method (if configured)
7
7
  def self.log(severity, message)
8
- Resque.logger.__send__(severity, message) if Resque.logger
8
+ ResqueAdmin.logger.__send__(severity, message) if ResqueAdmin.logger
9
9
  end
10
10
 
11
11
  # Log level aliases
@@ -1,4 +1,4 @@
1
- module Resque
1
+ module ResqueAdmin
2
2
  module Plugin
3
3
  extend self
4
4
 
@@ -6,7 +6,7 @@ module Resque
6
6
 
7
7
  # Ensure that your plugin conforms to good hook naming conventions.
8
8
  #
9
- # Resque::Plugin.lint(MyResquePlugin)
9
+ # ResqueAdmin::Plugin.lint(MyResquePlugin)
10
10
  def lint(plugin)
11
11
  hooks = before_hooks(plugin) + around_hooks(plugin) + after_hooks(plugin)
12
12
 
@@ -1,4 +1,4 @@
1
- Resque::Server.helpers do
1
+ ResqueAdmin::Server.helpers do
2
2
  ####################
3
3
  #failed.erb helpers#
4
4
  ####################
@@ -9,11 +9,11 @@ Resque::Server.helpers do
9
9
 
10
10
  def failed_multiple_queues?
11
11
  return @multiple_failed_queues if defined?(@multiple_failed_queues)
12
- @multiple_failed_queues = Resque::Failure.queues.size > 1
12
+ @multiple_failed_queues = ResqueAdmin::Failure.queues.size > 1
13
13
  end
14
14
 
15
15
  def failed_size
16
- @failed_size ||= Resque::Failure.count(params[:queue], params[:class])
16
+ @failed_size ||= ResqueAdmin::Failure.count(params[:queue], params[:class])
17
17
  end
18
18
 
19
19
  def failed_per_page
@@ -42,7 +42,7 @@ Resque::Server.helpers do
42
42
 
43
43
  def failed_class_counts(queue = params[:queue])
44
44
  classes = Hash.new(0)
45
- Resque::Failure.each(0, Resque::Failure.count(queue), queue) do |_, item|
45
+ ResqueAdmin::Failure.each(0, ResqueAdmin::Failure.count(queue), queue) do |_, item|
46
46
  class_name = item['payload']['class'] if item['payload']
47
47
  class_name ||= "nil"
48
48
  classes[class_name] += 1
@@ -1,12 +1,12 @@
1
1
  require 'rack/test'
2
2
  require 'resque_admin/server'
3
3
 
4
- module Resque
4
+ module ResqueAdmin
5
5
  module TestHelper
6
6
  class Test::Unit::TestCase
7
7
  include Rack::Test::Methods
8
8
  def app
9
- Resque::Server.new
9
+ ResqueAdmin::Server.new
10
10
  end
11
11
 
12
12
  def self.should_respond_with_success
@@ -1,5 +1,5 @@
1
1
  <% if failed_multiple_queues? && !params[:queue] %>
2
- <h1>All Failed Queues: <%= Resque::Failure.queues.size %> total</h1>
2
+ <h1>All Failed Queues: <%= ResqueAdmin::Failure.queues.size %> total</h1>
3
3
  <% else %>
4
4
  <h1>Failed Jobs <%= "on '#{params[:queue]}'" if params[:queue] %> <%= "with class '#{params[:class]}'" if params[:class] %></h1>
5
5
  <% end %>
@@ -20,7 +20,7 @@
20
20
 
21
21
 
22
22
  <ul class='failed'>
23
- <% Resque::Failure.each(failed_start_at, failed_per_page, params[:queue], params[:class], failed_order) do |id, job| %>
23
+ <% ResqueAdmin::Failure.each(failed_start_at, failed_per_page, params[:queue], params[:class], failed_order) do |id, job| %>
24
24
  <%= partial :failed_job, :id => id, :job => job, :queue => "failed#{'/' + params[:queue] if params[:queue]}" %>
25
25
  <% end %>
26
26
  </ul>
@@ -2,13 +2,13 @@
2
2
  <tbody>
3
3
  <tr class="total">
4
4
  <td class='queue'>Total Failed</td>
5
- <td class='center'><%= Resque::Failure.count %></td>
5
+ <td class='center'><%= ResqueAdmin::Failure.count %></td>
6
6
  </tr>
7
7
 
8
- <% Resque::Failure.queues.sort.each do |queue| %>
8
+ <% ResqueAdmin::Failure.queues.sort.each do |queue| %>
9
9
  <tr>
10
10
  <th><b class="queue-tag"><a href="<%= u "/failed/#{queue}" %>"><%= queue %></a></b></th>
11
- <th style="width:75px;" class="center"><%= Resque::Failure.count(queue) %></th>
11
+ <th style="width:75px;" class="center"><%= ResqueAdmin::Failure.count(queue) %></th>
12
12
  </tr>
13
13
 
14
14
  <% failed_class_counts(queue).sort_by { |name,_| name }.each do |k, v| %>
@@ -2,7 +2,7 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
- <title>Resque</title>
5
+ <title>ResqueAdmin</title>
6
6
  <link href="<%=u 'reset.css' %>" media="screen" rel="stylesheet" type="text/css">
7
7
  <link href="<%=u 'style.css' %>" media="screen" rel="stylesheet" type="text/css">
8
8
  <script src="<%=u 'jquery-1.12.4.min.js' %>" type="text/javascript"></script>
@@ -16,9 +16,9 @@
16
16
  <%= tab tab_name %>
17
17
  <% end %>
18
18
  </ul>
19
- <% if Resque.redis.namespace != :resque %>
20
- <abbr class="namespace" title="Resque's Redis Namespace">
21
- <%= Resque.redis.namespace %>
19
+ <% if ResqueAdmin.redis.namespace != :resque %>
20
+ <abbr class="namespace" title="ResqueAdmin's Redis Namespace">
21
+ <%= ResqueAdmin.redis.namespace %>
22
22
  </abbr>
23
23
  <% end %>
24
24
  </div>
@@ -36,8 +36,8 @@
36
36
  </div>
37
37
 
38
38
  <div id="footer">
39
- <p>Powered by <a href="http://github.com/resque/resque">Resque</a> v<%=Resque::Version%></p>
40
- <p>Connected to Redis namespace <%= Resque.redis.namespace %> on <%=Resque.redis_id%></p>
39
+ <p>Powered by <a href="http://github.com/resque/resque">ResqueAdmin</a> v<%=ResqueAdmin::Version%></p>
40
+ <p>Connected to Redis namespace <%= ResqueAdmin.redis.namespace %> on <%=ResqueAdmin.redis_id%></p>
41
41
  </div>
42
42
 
43
43
  </body>
@@ -41,16 +41,16 @@
41
41
  </tr>
42
42
  <% end %>
43
43
  <% if failed_multiple_queues? %>
44
- <% Resque::Failure.queues.sort_by { |q| q.to_s }.each_with_index do |queue, i| %>
45
- <tr class="<%= Resque::Failure.count(queue).zero? ? "failed" : "failure" %><%= " first_failure" if i.zero? %>">
44
+ <% ResqueAdmin::Failure.queues.sort_by { |q| q.to_s }.each_with_index do |queue, i| %>
45
+ <tr class="<%= ResqueAdmin::Failure.count(queue).zero? ? "failed" : "failure" %><%= " first_failure" if i.zero? %>">
46
46
  <td class='queue failed'><a class="queue" href="<%= u "failed/#{queue}" %>"><%= queue %></a></td>
47
- <td class='size'><%= Resque::Failure.count(queue) %></td>
47
+ <td class='size'><%= ResqueAdmin::Failure.count(queue) %></td>
48
48
  </tr>
49
49
  <% end %>
50
50
  <% else %>
51
- <tr class="<%= Resque::Failure.count.zero? ? "failed" : "failure" %>">
51
+ <tr class="<%= ResqueAdmin::Failure.count.zero? ? "failed" : "failure" %>">
52
52
  <td class='queue failed'><a class="queue" href="<%= u :failed %>">failed</a></td>
53
- <td class='size'><%= Resque::Failure.count %></td>
53
+ <td class='size'><%= ResqueAdmin::Failure.count %></td>
54
54
  </tr>
55
55
  <% end %>
56
56
  </table>
@@ -39,7 +39,7 @@
39
39
  <% elsif params[:id] == 'keys' %>
40
40
 
41
41
  <h1>Keys owned by <%= resque %></h1>
42
- <p class='sub'>(All keys are actually prefixed with "<%= Resque.redis.namespace %>:")</p>
42
+ <p class='sub'>(All keys are actually prefixed with "<%= ResqueAdmin.redis.namespace %>:")</p>
43
43
  <table class='stats'>
44
44
  <tr>
45
45
  <th>key</th>
@@ -1,6 +1,6 @@
1
1
  <% @subtabs = worker_hosts.keys.sort unless worker_hosts.size == 1 %>
2
2
 
3
- <% if params[:id] && worker = Resque::Worker.find(params[:id]) %>
3
+ <% if params[:id] && worker = ResqueAdmin::Worker.find(params[:id]) %>
4
4
 
5
5
  <h1>Worker <%= worker %></h1>
6
6
  <table class='workers'>
@@ -44,9 +44,9 @@
44
44
  <% elsif worker_hosts.size == 1 || params[:id] %>
45
45
 
46
46
  <% if worker_hosts.size == 1 || params[:id] == 'all' %>
47
- <% workers = Resque.workers %>
47
+ <% workers = ResqueAdmin.workers %>
48
48
  <% else %>
49
- <% workers = worker_hosts[params[:id]].map { |id| Resque::Worker.find(id) } %>
49
+ <% workers = worker_hosts[params[:id]].map { |id| ResqueAdmin::Worker.find(id) } %>
50
50
  <% end %>
51
51
 
52
52
  <h1 class='wi'><%= workers.size %> Workers</h1>
@@ -101,7 +101,7 @@
101
101
  <% end %>
102
102
  <tr class="failed">
103
103
  <td class='queue failed'><a class="queue" href="<%= u "workers/all" %>">all workers</a></td>
104
- <td class='size'><%= Resque.workers.size %></td>
104
+ <td class='size'><%= ResqueAdmin.workers.size %></td>
105
105
  </tr>
106
106
  </table>
107
107
 
@@ -1,4 +1,4 @@
1
- <% if params[:id] && (worker = Resque::Worker.find(params[:id])) && (data = worker.job) %>
1
+ <% if params[:id] && (worker = ResqueAdmin::Worker.find(params[:id])) && (data = worker.job) %>
2
2
  <h1><%= worker %>'s job</h1>
3
3
 
4
4
  <table>