resque_admin 0.2.0 → 1.0.2
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.
- checksums.yaml +4 -4
- data/HISTORY.md +30 -30
- data/README.markdown +83 -83
- data/Rakefile +1 -1
- data/bin/{resque-admin → resque} +8 -8
- data/bin/{resque-admin-web → resque-web} +5 -5
- data/lib/{resque_admin → resque}/data_store.rb +4 -4
- data/lib/{resque_admin → resque}/errors.rb +1 -1
- data/lib/{resque_admin → resque}/failure/airbrake.rb +4 -4
- data/lib/{resque_admin → resque}/failure/base.rb +1 -1
- data/lib/{resque_admin → resque}/failure/multiple.rb +2 -2
- data/lib/{resque_admin → resque}/failure/redis.rb +7 -7
- data/lib/{resque_admin → resque}/failure/redis_multi_queue.rb +11 -11
- data/lib/{resque_admin → resque}/failure.rb +8 -8
- data/lib/{resque_admin → resque}/helpers.rb +9 -9
- data/lib/{resque_admin → resque}/job.rb +22 -22
- data/lib/{resque_admin → resque}/log_formatters/quiet_formatter.rb +1 -1
- data/lib/{resque_admin → resque}/log_formatters/verbose_formatter.rb +1 -1
- data/lib/{resque_admin → resque}/log_formatters/very_verbose_formatter.rb +1 -1
- data/lib/{resque_admin → resque}/logging.rb +2 -2
- data/lib/{resque_admin → resque}/plugin.rb +2 -2
- data/lib/{resque_admin → resque}/server/helpers.rb +4 -4
- data/lib/{resque_admin → resque}/server/public/favicon.ico +0 -0
- data/lib/{resque_admin → resque}/server/public/idle.png +0 -0
- data/lib/{resque_admin → resque}/server/public/jquery-1.12.4.min.js +0 -0
- data/lib/{resque_admin → resque}/server/public/jquery.relatize_date.js +0 -0
- data/lib/{resque_admin → resque}/server/public/poll.png +0 -0
- data/lib/{resque_admin → resque}/server/public/ranger.js +0 -0
- data/lib/{resque_admin → resque}/server/public/reset.css +0 -0
- data/lib/{resque_admin → resque}/server/public/style.css +0 -0
- data/lib/{resque_admin → resque}/server/public/working.png +0 -0
- data/lib/{resque_admin → resque}/server/test_helper.rb +3 -3
- data/lib/{resque_admin → resque}/server/views/error.erb +0 -0
- data/lib/{resque_admin → resque}/server/views/failed.erb +2 -2
- data/lib/{resque_admin → resque}/server/views/failed_job.erb +0 -0
- data/lib/{resque_admin → resque}/server/views/failed_queues_overview.erb +3 -3
- data/lib/{resque_admin → resque}/server/views/job_class.erb +0 -0
- data/lib/{resque_admin → resque}/server/views/key_sets.erb +0 -0
- data/lib/{resque_admin → resque}/server/views/key_string.erb +0 -0
- data/lib/{resque_admin → resque}/server/views/layout.erb +6 -6
- data/lib/{resque_admin → resque}/server/views/next_more.erb +0 -0
- data/lib/{resque_admin → resque}/server/views/overview.erb +0 -0
- data/lib/{resque_admin → resque}/server/views/processing.erb +0 -0
- data/lib/{resque_admin → resque}/server/views/queues.erb +5 -5
- data/lib/{resque_admin → resque}/server/views/stats.erb +1 -1
- data/lib/{resque_admin → resque}/server/views/workers.erb +4 -4
- data/lib/{resque_admin → resque}/server/views/working.erb +1 -1
- data/lib/{resque_admin → resque}/server.rb +35 -35
- data/lib/{resque_admin → resque}/stat.rb +2 -2
- data/lib/{resque_admin → resque}/tasks.rb +11 -11
- data/lib/{resque_admin → resque}/thread_signal.rb +1 -1
- data/lib/{resque_admin → resque}/vendor/utf8_util.rb +0 -0
- data/lib/resque/version.rb +3 -0
- data/lib/{resque_admin → resque}/worker.rb +29 -29
- data/lib/{resque_admin.rb → resque.rb} +27 -27
- data/lib/tasks/{resque_admin.rake → resque.rake} +1 -1
- metadata +60 -60
- data/lib/resque_admin/version.rb +0 -3
@@ -4,19 +4,19 @@ rescue LoadError
|
|
4
4
|
raise "Can't find 'airbrake' gem. Please add it to your Gemfile or install it."
|
5
5
|
end
|
6
6
|
|
7
|
-
module
|
7
|
+
module Resque
|
8
8
|
module Failure
|
9
9
|
class Airbrake < Base
|
10
10
|
def self.configure(&block)
|
11
|
-
|
11
|
+
Resque.logger.warn "This actually sets global Airbrake configuration, " \
|
12
12
|
"which is probably not what you want."
|
13
|
-
|
13
|
+
Resque::Failure.backend = self
|
14
14
|
::Airbrake.configure(&block)
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.count(queue = nil, class_name = nil)
|
18
18
|
# We can't get the total # of errors from Airbrake so we fake it
|
19
|
-
# by asking
|
19
|
+
# by asking Resque how many errors it has seen.
|
20
20
|
Stat[:failed]
|
21
21
|
end
|
22
22
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module Resque
|
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 ResqueAdmin
|
|
10
10
|
|
11
11
|
def self.configure
|
12
12
|
yield self
|
13
|
-
|
13
|
+
Resque::Failure.backend = self
|
14
14
|
end
|
15
15
|
|
16
16
|
def initialize(*args)
|
@@ -1,15 +1,15 @@
|
|
1
|
-
module
|
1
|
+
module Resque
|
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
|
4
|
+
# works out of the box, along with support in the Resque web app.
|
5
5
|
class Redis < Base
|
6
6
|
|
7
7
|
def data_store
|
8
|
-
|
8
|
+
Resque.data_store
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.data_store
|
12
|
-
|
12
|
+
Resque.data_store
|
13
13
|
end
|
14
14
|
|
15
15
|
def save
|
@@ -22,7 +22,7 @@ module ResqueAdmin
|
|
22
22
|
:worker => worker.to_s,
|
23
23
|
:queue => queue
|
24
24
|
}
|
25
|
-
data =
|
25
|
+
data = Resque.encode(data)
|
26
26
|
data_store.push_to_failed_queue(data)
|
27
27
|
end
|
28
28
|
|
@@ -44,7 +44,7 @@ module ResqueAdmin
|
|
44
44
|
|
45
45
|
def self.all(offset = 0, limit = 1, queue = nil)
|
46
46
|
check_queue(queue)
|
47
|
-
|
47
|
+
Resque.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 ResqueAdmin
|
|
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,
|
82
|
+
data_store.update_item_in_failed_queue(id,Resque.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
|
1
|
+
module Resque
|
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
|
4
|
+
# works out of the box, along with support in the Resque web app.
|
5
5
|
class RedisMultiQueue < Base
|
6
6
|
|
7
7
|
def data_store
|
8
|
-
|
8
|
+
Resque.data_store
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.data_store
|
12
|
-
|
12
|
+
Resque.data_store
|
13
13
|
end
|
14
14
|
|
15
15
|
def save
|
@@ -22,8 +22,8 @@ module ResqueAdmin
|
|
22
22
|
:worker => worker.to_s,
|
23
23
|
:queue => queue
|
24
24
|
}
|
25
|
-
data =
|
26
|
-
data_store.push_to_failed_queue(data,
|
25
|
+
data = Resque.encode(data)
|
26
|
+
data_store.push_to_failed_queue(data,Resque::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 ResqueAdmin
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def self.all(offset = 0, limit = 1, queue = :failed)
|
46
|
-
|
46
|
+
Resque.list_range(queue, offset, limit)
|
47
47
|
end
|
48
48
|
|
49
49
|
def self.queues
|
@@ -74,7 +74,7 @@ module ResqueAdmin
|
|
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,
|
77
|
+
data_store.update_item_in_failed_queue(id,Resque.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 ResqueAdmin
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def self.requeue_queue(queue)
|
86
|
-
failure_queue =
|
86
|
+
failure_queue = Resque::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(
|
91
|
+
queues.each { |queue| requeue_queue(Resque::Failure.job_queue_name(queue)) }
|
92
92
|
end
|
93
93
|
|
94
94
|
def self.remove_queue(queue)
|
95
|
-
data_store.remove_failed_queue(
|
95
|
+
data_store.remove_failed_queue(Resque::Failure.failure_queue_name(queue))
|
96
96
|
end
|
97
97
|
|
98
98
|
def filter_backtrace(backtrace)
|
@@ -1,9 +1,9 @@
|
|
1
|
-
module
|
1
|
+
module Resque
|
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
|
6
|
+
# backend is being used. For instance, the Resque 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,26 +19,26 @@ module ResqueAdmin
|
|
19
19
|
|
20
20
|
#
|
21
21
|
# Sets the current backend. Expects a class descendent of
|
22
|
-
# `
|
22
|
+
# `Resque::Failure::Base`.
|
23
23
|
#
|
24
24
|
# Example use:
|
25
25
|
# require 'resque/failure/airbrake'
|
26
|
-
#
|
26
|
+
# Resque::Failure.backend = Resque::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 `
|
32
|
+
# back to `Resque::Failure::Redis`
|
33
33
|
def self.backend
|
34
34
|
return @backend if @backend
|
35
35
|
|
36
36
|
case ENV['FAILURE_BACKEND']
|
37
37
|
when 'redis_multi_queue'
|
38
|
-
require '
|
38
|
+
require 'resque/failure/redis_multi_queue'
|
39
39
|
@backend = Failure::RedisMultiQueue
|
40
40
|
when 'redis', nil
|
41
|
-
require '
|
41
|
+
require 'resque/failure/redis'
|
42
42
|
@backend = Failure::Redis
|
43
43
|
else
|
44
44
|
raise ArgumentError, "invalid failure backend: #{FAILURE_BACKEND}"
|
@@ -48,7 +48,7 @@ module ResqueAdmin
|
|
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
|
-
|
51
|
+
Resque.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
|
12
|
-
# Methods used by various classes in
|
11
|
+
module Resque
|
12
|
+
# Methods used by various classes in Resque.
|
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
|
20
|
-
#
|
19
|
+
# Some external libraries depend on Resque::Helpers being mixed into
|
20
|
+
# Resque, 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
|
-
|
24
|
+
Resque.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
|
-
|
30
|
+
Resque.encode(object)
|
31
31
|
end
|
32
32
|
|
33
33
|
# Given a string, returns a Ruby object.
|
34
34
|
def decode(object)
|
35
|
-
|
35
|
+
Resque.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
|
-
|
40
|
+
Resque.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
|
-
|
45
|
+
Resque.constantize(camel_cased_word)
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module
|
2
|
-
# A
|
1
|
+
module Resque
|
2
|
+
# A Resque::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 ResqueAdmin
|
|
8
8
|
#
|
9
9
|
# You can manually run a job using this code:
|
10
10
|
#
|
11
|
-
# job =
|
12
|
-
# klass =
|
11
|
+
# job = Resque::Job.reserve(:high)
|
12
|
+
# klass = Resque::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
|
-
|
18
|
+
Resque.redis
|
19
19
|
end
|
20
20
|
alias :data_store :redis
|
21
21
|
|
22
22
|
def self.redis
|
23
|
-
|
23
|
+
Resque.redis
|
24
24
|
end
|
25
25
|
|
26
26
|
def self.data_store
|
@@ -30,36 +30,36 @@ module ResqueAdmin
|
|
30
30
|
# Given a Ruby object, returns a string suitable for storage in a
|
31
31
|
# queue.
|
32
32
|
def encode(object)
|
33
|
-
|
33
|
+
Resque.encode(object)
|
34
34
|
end
|
35
35
|
|
36
36
|
# Given a string, returns a Ruby object.
|
37
37
|
def decode(object)
|
38
|
-
|
38
|
+
Resque.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
|
-
|
44
|
+
Resque.encode(object)
|
45
45
|
end
|
46
46
|
|
47
47
|
# Given a string, returns a Ruby object.
|
48
48
|
def self.decode(object)
|
49
|
-
|
49
|
+
Resque.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
|
-
|
54
|
+
Resque.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
|
-
|
59
|
+
Resque.constantize(camel_cased_word)
|
60
60
|
end
|
61
61
|
|
62
|
-
# Raise
|
62
|
+
# Raise Resque::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 ResqueAdmin
|
|
85
85
|
#
|
86
86
|
# Raises an exception if no queue or class is given.
|
87
87
|
def self.create(queue, klass, *args)
|
88
|
-
|
88
|
+
Resque.validate(klass, queue)
|
89
89
|
|
90
|
-
if
|
91
|
-
# Instantiating a
|
90
|
+
if Resque.inline?
|
91
|
+
# Instantiating a Resque::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
|
-
|
95
|
+
Resque.push(queue, :class => klass.to_s, :args => args)
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
@@ -111,11 +111,11 @@ module ResqueAdmin
|
|
111
111
|
#
|
112
112
|
# The following call will remove both:
|
113
113
|
#
|
114
|
-
#
|
114
|
+
# Resque::Job.destroy(queue, 'UpdateGraph')
|
115
115
|
#
|
116
116
|
# Whereas specifying args will only remove the 2nd job:
|
117
117
|
#
|
118
|
-
#
|
118
|
+
# Resque::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 ResqueAdmin
|
|
137
137
|
destroyed
|
138
138
|
end
|
139
139
|
|
140
|
-
# Given a string queue name, returns an instance of
|
140
|
+
# Given a string queue name, returns an instance of Resque::Job
|
141
141
|
# if any jobs are available. If not, returns nil.
|
142
142
|
def self.reserve(queue)
|
143
|
-
return unless payload =
|
143
|
+
return unless payload = Resque.pop(queue)
|
144
144
|
new(queue, payload)
|
145
145
|
end
|
146
146
|
|
@@ -154,7 +154,7 @@ module ResqueAdmin
|
|
154
154
|
|
155
155
|
begin
|
156
156
|
# Execute before_perform hook. Abort the job gracefully if
|
157
|
-
#
|
157
|
+
# Resque::DontPerform is raised.
|
158
158
|
begin
|
159
159
|
before_hooks.each do |hook|
|
160
160
|
job.send(hook, *job_args)
|
@@ -1,11 +1,11 @@
|
|
1
|
-
module
|
1
|
+
module Resque
|
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
|
-
|
8
|
+
Resque.logger.__send__(severity, message) if Resque.logger
|
9
9
|
end
|
10
10
|
|
11
11
|
# Log level aliases
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module Resque
|
2
2
|
module Plugin
|
3
3
|
extend self
|
4
4
|
|
@@ -6,7 +6,7 @@ module ResqueAdmin
|
|
6
6
|
|
7
7
|
# Ensure that your plugin conforms to good hook naming conventions.
|
8
8
|
#
|
9
|
-
#
|
9
|
+
# Resque::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
|
-
|
1
|
+
Resque::Server.helpers do
|
2
2
|
####################
|
3
3
|
#failed.erb helpers#
|
4
4
|
####################
|
@@ -9,11 +9,11 @@ ResqueAdmin::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 =
|
12
|
+
@multiple_failed_queues = Resque::Failure.queues.size > 1
|
13
13
|
end
|
14
14
|
|
15
15
|
def failed_size
|
16
|
-
@failed_size ||=
|
16
|
+
@failed_size ||= Resque::Failure.count(params[:queue], params[:class])
|
17
17
|
end
|
18
18
|
|
19
19
|
def failed_per_page
|
@@ -42,7 +42,7 @@ ResqueAdmin::Server.helpers do
|
|
42
42
|
|
43
43
|
def failed_class_counts(queue = params[:queue])
|
44
44
|
classes = Hash.new(0)
|
45
|
-
|
45
|
+
Resque::Failure.each(0, Resque::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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'rack/test'
|
2
|
-
require '
|
2
|
+
require 'resque/server'
|
3
3
|
|
4
|
-
module
|
4
|
+
module Resque
|
5
5
|
module TestHelper
|
6
6
|
class Test::Unit::TestCase
|
7
7
|
include Rack::Test::Methods
|
8
8
|
def app
|
9
|
-
|
9
|
+
Resque::Server.new
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.should_respond_with_success
|
File without changes
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% if failed_multiple_queues? && !params[:queue] %>
|
2
|
-
<h1>All Failed Queues: <%=
|
2
|
+
<h1>All Failed Queues: <%= Resque::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
|
-
<%
|
23
|
+
<% Resque::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>
|
File without changes
|
@@ -2,13 +2,13 @@
|
|
2
2
|
<tbody>
|
3
3
|
<tr class="total">
|
4
4
|
<td class='queue'>Total Failed</td>
|
5
|
-
<td class='center'><%=
|
5
|
+
<td class='center'><%= Resque::Failure.count %></td>
|
6
6
|
</tr>
|
7
7
|
|
8
|
-
<%
|
8
|
+
<% Resque::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"><%=
|
11
|
+
<th style="width:75px;" class="center"><%= Resque::Failure.count(queue) %></th>
|
12
12
|
</tr>
|
13
13
|
|
14
14
|
<% failed_class_counts(queue).sort_by { |name,_| name }.each do |k, v| %>
|
File without changes
|
File without changes
|
File without changes
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<html lang="en">
|
3
3
|
<head>
|
4
4
|
<meta charset="utf-8" />
|
5
|
-
<title>
|
5
|
+
<title>Resque</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
|
20
|
-
<abbr class="namespace" title="
|
21
|
-
<%=
|
19
|
+
<% if Resque.redis.namespace != :resque %>
|
20
|
+
<abbr class="namespace" title="Resque's Redis Namespace">
|
21
|
+
<%= Resque.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">
|
40
|
-
<p>Connected to Redis namespace <%=
|
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>
|
41
41
|
</div>
|
42
42
|
|
43
43
|
</body>
|
File without changes
|
File without changes
|
File without changes
|
@@ -41,16 +41,16 @@
|
|
41
41
|
</tr>
|
42
42
|
<% end %>
|
43
43
|
<% if failed_multiple_queues? %>
|
44
|
-
<%
|
45
|
-
<tr class="<%=
|
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? %>">
|
46
46
|
<td class='queue failed'><a class="queue" href="<%= u "failed/#{queue}" %>"><%= queue %></a></td>
|
47
|
-
<td class='size'><%=
|
47
|
+
<td class='size'><%= Resque::Failure.count(queue) %></td>
|
48
48
|
</tr>
|
49
49
|
<% end %>
|
50
50
|
<% else %>
|
51
|
-
<tr class="<%=
|
51
|
+
<tr class="<%= Resque::Failure.count.zero? ? "failed" : "failure" %>">
|
52
52
|
<td class='queue failed'><a class="queue" href="<%= u :failed %>">failed</a></td>
|
53
|
-
<td class='size'><%=
|
53
|
+
<td class='size'><%= Resque::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 "<%=
|
42
|
+
<p class='sub'>(All keys are actually prefixed with "<%= Resque.redis.namespace %>:")</p>
|
43
43
|
<table class='stats'>
|
44
44
|
<tr>
|
45
45
|
<th>key</th>
|