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

View File

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