1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Merge pull request #1192 from minio-sk/feature-show-errors

Show errors for retried jobs
This commit is contained in:
Mike Perham 2013-09-21 06:27:46 -07:00
commit 40240e55ee
2 changed files with 9 additions and 1 deletions

View file

@ -107,10 +107,14 @@ module Sidekiq
[score.to_f, jid]
end
def truncate(text, truncate_after_chars = 2000)
truncate_after_chars && text.size > truncate_after_chars ? "#{text[0..truncate_after_chars]}..." : text
end
def display_args(args, truncate_after_chars = 2000)
args.map do |arg|
a = arg.inspect
truncate_after_chars && a.size > truncate_after_chars ? "#{a[0..truncate_after_chars]}..." : a
truncate(a)
end.join(", ")
end

View file

@ -21,6 +21,7 @@
<th><%= t('Queue') %></th>
<th><%= t('Worker') %></th>
<th><%= t('Arguments') %></th>
<th><%= t('Error') %></th>
</tr>
<% @retries.each do |msg, score| %>
<tr>
@ -38,6 +39,9 @@
<td>
<div class="args"><%= display_args(msg['args']) %></div>
</td>
<td>
<div><%= truncate("#{msg['error_class']}: #{msg['error_message']}") %></div>
</td>
</tr>
<% end %>
</table>