Skip to content

Commit

Permalink
Support new recurring task features
Browse files Browse the repository at this point in the history
  • Loading branch information
rosa committed Sep 9, 2024
1 parent 7f71ec8 commit d0adeae
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ GEM
erubi (1.12.0)
et-orbi (1.2.11)
tzinfo
fugit (1.11.0)
fugit (1.11.1)
et-orbi (~> 1, >= 1.2.11)
raabro (~> 1.4)
globalid (1.2.1)
Expand Down
2 changes: 1 addition & 1 deletion app/models/mission_control/jobs/recurring_task.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class MissionControl::Jobs::RecurringTask
include ActiveModel::Model

attr_accessor :id, :job_class_name, :arguments, :schedule, :last_enqueued_at
attr_accessor :id, :job_class_name, :command, :arguments, :schedule, :last_enqueued_at, :queue_name, :priority

def initialize(queue_adapter: ActiveJob::Base.queue_adapter, **kwargs)
@queue_adapter = queue_adapter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
<table class="table">
<tbody>
<tr>
<th>Job class</th>
<td><%= recurring_task.job_class_name %></td>
</tr>
<tr>
<th>Arguments</th>
<td><div class="is-family-monospace"><%= recurring_task.arguments.join(",") %></div></td>
</tr>
<% if recurring_task.job_class_name.present? %>
<tr>
<th>Job class</th>
<td><%= recurring_task.job_class_name %></td>
</tr>

<tr>
<th>Arguments</th>
<td><div class="is-family-monospace"><%= recurring_task.arguments.join(",") %></div></td>
</tr>
<% elsif recurring_task.command.present? %>
<tr>
<th>Command</th>
<td><div class="is-family-monospace"><%= recurring_task.command %></div></td>
</tr>
<% end %>

<tr>
<th>Schedule</th>
<td><%= recurring_task.schedule %></td>
</tr>
<% if recurring_task.queue_name.present? %>
<tr>
<th>Queue</th>
<td><%= recurring_task.queue_name %></td>
</tr>
<% end %>
<% if recurring_task.priority.present? %>
<tr>
<th>Priority</th>
<td><%= recurring_task.priority %></td>
</tr>
<% end %>
</tbody>
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
<%= link_to recurring_task.id, application_recurring_task_path(@application, recurring_task.id) %>
</td>
<td>
<%= link_to recurring_task.job_class_name, application_recurring_task_path(@application, recurring_task.id) %>
<% if recurring_task.job_class_name.present? %>
<%= recurring_task.job_class_name %>
<% if recurring_task.arguments.present? %>
<div class="is-family-monospace"><%= recurring_task.arguments.join(",") %></div>
<% if recurring_task.arguments.present? %>
<div class="is-family-monospace"><%= recurring_task.arguments.join(",") %></div>
<% end %>
<% elsif recurring_task.command.present? %>
<div class="is-family-monospace"><%= recurring_task.command %></div>
<% end %>
</td>
<td> <%= recurring_task.schedule %> </td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ def recurring_task_attributes_from_solid_queue_recurring_task(task)
{
id: task.key,
job_class_name: task.class_name,
command: task.command,
arguments: task.arguments,
schedule: task.schedule
schedule: task.schedule,
queue_name: task.queue_name,
priority: task.priority
}
end

Expand Down
2 changes: 1 addition & 1 deletion mission_control-jobs.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "irb", "~> 1.13"

spec.add_development_dependency "resque"
spec.add_development_dependency "solid_queue", ">= 0.5"
spec.add_development_dependency "solid_queue", ">= 0.9"
spec.add_development_dependency "selenium-webdriver"
spec.add_development_dependency "resque-pause"
spec.add_development_dependency "mocha"
Expand Down

0 comments on commit d0adeae

Please sign in to comment.