mirror of
https://github.com/endofunky/sidetiq.git
synced 2022-11-09 13:53:30 -05:00
Problem: When runtime is nil, a no method error is raised for round on nil:NilClass.
Solution: Use lonely operator to handle nil value for runtime and display N/A in these cases.
This commit is contained in:
parent
6b3eb441e8
commit
59a217598a
1 changed files with 2 additions and 1 deletions
|
@ -23,10 +23,11 @@
|
|||
|
||||
<% @history.each do |entry| %>
|
||||
<% entry = Sidekiq.load_json(entry).symbolize_keys %>
|
||||
<% runtime = entry[:runtime]&.round(3) || "N/A" %>
|
||||
<tr class="<%= 'error' if entry[:status] == 'failure' %>">
|
||||
<td><%= entry[:status].capitalize %></td>
|
||||
<td><%= Time.parse(entry[:timestamp]).strftime("%m/%d/%Y %I:%M:%S%p") %></td>
|
||||
<td><%= entry[:runtime].round(3) %> s</td>
|
||||
<td><%= runtime %> s</td>
|
||||
<td>
|
||||
<% if entry[:status] == 'failure' %>
|
||||
<a class="backtrace" href="#" onclick="$(this).next().toggle(); return false">
|
||||
|
|
Loading…
Reference in a new issue