resque-mongo-groups 0.6.1 → 0.6.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.
@@ -35,7 +35,14 @@
|
|
35
35
|
<td><%= group['delayed'] %></td>
|
36
36
|
<td><%= group['completed'] %></td>
|
37
37
|
<td><%= group['failed'] %></td>
|
38
|
-
<td
|
38
|
+
<td>
|
39
|
+
<% if group['exceptions'] && !group['exceptions'].empty? %>
|
40
|
+
<% exceptions = group['exceptions'].collect { |exception| escape_html(exception) } %>
|
41
|
+
<ul><li><%= exceptions.join('</li><li>') %></li></ul>
|
42
|
+
<% else %>
|
43
|
+
|
44
|
+
<% end %>
|
45
|
+
</td>
|
39
46
|
<td><%= escape_html(group['custom'].inspect) if group['custom'] %></td>
|
40
47
|
</tr>
|
41
48
|
<% end %>
|
@@ -37,7 +37,7 @@ module Resque::Plugins::Groups
|
|
37
37
|
# resque hook, triggered if a job raises any exception. uncaught exceptions propagate up to Resque::Failure
|
38
38
|
def on_failure_update_failed(exception, *args)
|
39
39
|
gid = Resque.parse_gid(*args)
|
40
|
-
Resque.record_failed_job(gid, exception)
|
40
|
+
Resque.record_failed_job(gid, exception, *args)
|
41
41
|
end
|
42
42
|
|
43
43
|
# Determines if this was a delayed job or not, based on the :delayed => true arg
|
data/lib/resque_groups.rb
CHANGED
@@ -52,12 +52,13 @@ module Resque::Plugins::Groups
|
|
52
52
|
#Resque.print_groups
|
53
53
|
end
|
54
54
|
|
55
|
-
# Increments the 'failed' count of the group with id 'gid'
|
56
|
-
|
55
|
+
# Increments the 'failed' count of the group with id 'gid'.
|
56
|
+
# Store the exception details, and the job payload.
|
57
|
+
def record_failed_job(gid, exception, *payload)
|
57
58
|
job_groups.update( {'_id' => gid},
|
58
59
|
{
|
59
60
|
'$inc' => {'failed' => 1},
|
60
|
-
'$push' => {'exceptions' => exception.inspect},
|
61
|
+
'$push' => {'exceptions' => [exception.inspect, exception.backtrace, payload]},
|
61
62
|
'$set' => {'updated_at' => Time.now}
|
62
63
|
}, {:upsert => true})
|
63
64
|
#Resque.print_groups
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: resque-mongo-groups
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.6.
|
5
|
+
version: 0.6.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Gheorghita Catalin Bordianu
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-05-30 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|