Fix backfill LiveStash recovery: always set all required assigns
This commit is contained in:
parent
d275e9e7c4
commit
ae0e667cab
1 changed files with 15 additions and 15 deletions
|
|
@ -21,22 +21,22 @@ defmodule MicrowavepropWeb.BackfillLive do
|
|||
unprocessed = count_unprocessed()
|
||||
db_stats = fetch_db_stats()
|
||||
|
||||
case LiveStash.recover_state(socket) do
|
||||
{:recovered, socket} ->
|
||||
{:ok, assign(socket, stats: stats, unprocessed: unprocessed, db_stats: db_stats)}
|
||||
{limit, _} =
|
||||
case LiveStash.recover_state(socket) do
|
||||
{:recovered, socket} -> {socket.assigns[:limit] || 500, socket}
|
||||
_ -> {500, socket}
|
||||
end
|
||||
|
||||
_ ->
|
||||
{:ok,
|
||||
assign(socket,
|
||||
page_title: "Backfill",
|
||||
limit: 500,
|
||||
stats: stats,
|
||||
unprocessed: unprocessed,
|
||||
db_stats: db_stats,
|
||||
last_enqueued: nil,
|
||||
enqueuing: false
|
||||
)}
|
||||
end
|
||||
{:ok,
|
||||
assign(socket,
|
||||
page_title: "Backfill",
|
||||
limit: limit,
|
||||
stats: stats,
|
||||
unprocessed: unprocessed,
|
||||
db_stats: db_stats,
|
||||
last_enqueued: nil,
|
||||
enqueuing: false
|
||||
)}
|
||||
end
|
||||
|
||||
@impl true
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue