Skip to content

Commit

Permalink
Refresh the current job periodically
Browse files Browse the repository at this point in the history
  • Loading branch information
evilmarty committed Nov 11, 2024
1 parent d5cac0b commit 1d78255
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/oban/live_dashboard.ex
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ defmodule Oban.LiveDashboard do
{:noreply, assign(socket, job: nil)}
end

@impl true
def handle_refresh(socket) do
{:noreply,
Phoenix.Component.update(socket, :job, fn
nil -> nil
%{id: job_id} -> get_job(job_id)
end)}
end

@impl true
def handle_event("show_job", params, socket) do
to = live_dashboard_path(socket, socket.assigns.page, params: params)
Expand Down

0 comments on commit 1d78255

Please sign in to comment.