Skip to content

Commit

Permalink
Backoffice: affichage des jobs "retryable"
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitfred committed Nov 27, 2024
1 parent 9c26ae4 commit ef7b925
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions apps/transport/lib/transport_web/live/backoffice/jobs_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ defmodule TransportWeb.Backoffice.JobsLive do
count_scheduled_jobs: count_jobs("scheduled", worker_filter),
last_discarded_jobs: last_jobs("discarded", 5, worker_filter),
count_discarded_jobs: count_jobs("discarded", worker_filter),
retryable_jobs: last_jobs("retryable", 5, worker_filter),
last_retryable_jobs: last_jobs("retryable", 5, worker_filter),
count_retryable_jobs: count_jobs("retryable", worker_filter),
jobs_count: jobs_count(worker_filter)
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
<.live_component module={JobsTableComponent} jobs={@scheduled_jobs} state="scheduled" id="scheduled_jobs" />
<p class="small">Total: <%= Helpers.format_number(@count_scheduled_jobs, locale: "en") %></p>

<h2>Retryable jobs</h2>
<.live_component module={JobsTableComponent} jobs={@retryable_jobs} state="retryable" id="retryable_jobs" />
<p class="small">Total: <%= Helpers.format_number(@count_retryable_jobs, locale: "en") %></p>

<h2>Available jobs</h2>
<.live_component module={JobsTableComponent} jobs={@available_jobs} state="available" id="available_jobs" />
<p class="small">Total: <%= Helpers.format_number(@count_available_jobs, locale: "en") %></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ defmodule JobsTableComponent do
<th>worker</th>
<th>args</th>
<th>inserted_at (Paris time)</th>
<%= if @state == "discarded" do %>
<%= if @state in ["discarded", "retryable"] do %>
<th>errors</th>
<% end %>
<%= if @state == "scheduled" do %>
<%= if @state in ["scheduled", "retryable"] do %>
<th>scheduled_at (Paris time)</th>
<% end %>
</tr>
Expand All @@ -32,10 +32,10 @@ defmodule JobsTableComponent do
<td><%= job.worker %></td>
<td><%= inspect(job.args) %></td>
<td><%= format_datetime(job.inserted_at) %></td>
<%= if @state == "discarded" do %>
<%= if @state in ["discarded", "retryable"] do %>
<td><%= inspect(job.errors) %></td>
<% end %>
<%= if @state == "scheduled" do %>
<%= if @state in ["scheduled", "retryable"] do %>
<td><%= format_datetime(job.scheduled_at) %></td>
<% end %>
</tr>
Expand Down

0 comments on commit ef7b925

Please sign in to comment.