better formatting for delayed jobs

This commit is contained in:
albert
2013-03-15 13:29:07 -04:00
parent b5e5607902
commit 5ec4452777
2 changed files with 14 additions and 3 deletions

View File

@@ -1,11 +1,14 @@
module DelayedJobsHelper
def print_handler(job)
case job.name
when "Class#expire_cache"
"<strong>expire post count cache</strong>: " + job.payload_object.args.flatten.join(" ")
when "Upload#process!"
'<strong>upload post</strong>: <a href="/uploads/' + job.payload_object.object.id.to_s + '">record</a>'
when "Tag#update_related"
"none"
"<strong>update related tags</strong>: " + job.payload_object.name
when "TagAlias#process!"
'<strong>alias</strong>: ' + job.payload_object.antecedent_name + " -&gt; " + job.payload_object.consequent_name
@@ -13,8 +16,14 @@ module DelayedJobsHelper
when "TagImplication#process!"
'<strong>implication</strong>: ' + job.payload_object.antecedent_name + " -&gt; " + job.payload_object.consequent_name
when "TagAlias#clear_cache"
"none"
when "Class#clear_cache_for"
"<strong>expire tag alias cache</strong>: " + job.payload_object.flatten.join(" ")
when "Tag#update_category_cache"
"<strong>update tag category cache</strong>: " + job.payload_object.name
when "Tag#update_category_post_counts"
"<strong>update category post counts</strong>: " + job.payload_object.name
else
job.handler

View File

@@ -12,6 +12,7 @@
<th>Last error</th>
<th>Run at</th>
<th>Failed at</th>
<th>Queue</th>
</tr>
</thead>
<tbody>
@@ -26,6 +27,7 @@
<td><%= job.last_error %></td>
<td><%= job.run_at %></td>
<td><%= job.failed_at %></td>
<td><%= job.queue %></td>
</tr>
<% end %>
</tbody>