Queue Diagnostics

System Overview

<% stats = system_stats() %>

Pending Downloads

{stats.total_pending_downloads}

Downloaded Media

{stats.total_downloaded}

Total Sources

{stats.total_sources}

Database Size

{stats.database_size}

Queue Health

<.link href={~p"/diagnostics"}> <.button color="bg-bodydark" rounding="rounded-lg" class="text-sm"> <.icon name="hero-arrow-path" class="h-4 w-4 mr-1" /> Refresh
<%= for stats <- queue_stats() do %>

{format_queue_name(stats.name)}

{queue_status_text(stats)}
Running: {stats.running}/{stats.limit}
Available: {stats.available}
Scheduled: {stats.scheduled}
0, do: "text-red-400", else: "text-bodydark"}"}>Retryable: 0, do: "text-red-400 font-bold", else: "text-white"}"}> {stats.retryable}
<% end %>
<% stuck = stuck_jobs() %> <%= if length(stuck) > 0 do %>

<.icon name="hero-exclamation-triangle" class="h-5 w-5 text-yellow-500 mr-2" /> Stuck Jobs ({length(stuck)})

<.link href={~p"/diagnostics/reset_stuck_jobs"} method="post" data-confirm="This will reset all stuck jobs. They will be retried. Continue?" > <.button color="bg-yellow-600" rounding="rounded-lg" class="text-sm"> <.icon name="hero-arrow-path" class="h-4 w-4 mr-1" /> Reset All Stuck Jobs

These jobs have been executing for more than 30 minutes and may be orphaned. This can happen after a container restart.

<%= for job <- stuck do %> <% end %>
ID Queue Worker Started At Actions
#{job.id} {job.queue} {format_worker_name(job.worker)} {format_datetime(job.attempted_at)} <.link href={~p"/diagnostics/reset_job/#{job.id}"} method="post" class="text-primary hover:underline mr-3" > Reset <.link href={~p"/diagnostics/cancel_job/#{job.id}"} method="post" class="text-red-400 hover:underline" data-confirm="Cancel this job?" > Cancel
<% end %> <% retryable = retryable_jobs() %>

<.icon name="hero-exclamation-circle" class="h-5 w-5 text-red-500 mr-2" /> Failed Jobs ({length(retryable)})

<%= if length(retryable) > 0 do %> <.link href={~p"/diagnostics/reset_retryable_jobs"} method="post" data-confirm="This will reset all failed jobs and clear their error history. They will be retried from scratch. Continue?" > <.button color="bg-red-600" rounding="rounded-lg" class="text-sm"> <.icon name="hero-arrow-path" class="h-4 w-4 mr-1" /> Reset All Failed Jobs <% end %>
<%= if length(retryable) == 0 do %>

No failed jobs. Everything is running smoothly!

<% else %>

These jobs have failed and are waiting to be retried. You can reset them to retry immediately or cancel them.

<%= for job <- retryable do %> <% end %>
ID Queue Worker Attempts Last Error Actions
#{job.id} {job.queue} {format_worker_name(job.worker)} {job.attempt}/{job.max_attempts} {extract_last_error(job.errors)} <.link href={~p"/diagnostics/reset_job/#{job.id}"} method="post" class="text-primary hover:underline mr-3" > Reset <.link href={~p"/diagnostics/cancel_job/#{job.id}"} method="post" class="text-red-400 hover:underline" data-confirm="Cancel this job?" > Cancel
<% end %>