Skip to content

Commit

Permalink
Render cells as queued when restarting process
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Oct 21, 2023
1 parent dd1f750 commit 88408eb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
11 changes: 11 additions & 0 deletions src/notebook/Notebook.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ function _initial_nb_status()
return b
end

function _report_business_cells_planned!(notebook::Notebook)
run_status = Status.report_business_planned!(notebook.status_tree, :run)
Status.report_business_planned!(run_status, :resolve_topology)
cell_status = Status.report_business_planned!(run_status, :evaluate)
for (i,c) in enumerate(notebook.cells)
c.running = true
c.queued = true
Status.report_business_planned!(cell_status, Symbol(i))
end
end

_collect_cells(cells_dict::Dict{UUID,Cell}, cells_order::Vector{UUID}) =
map(i -> cells_dict[i], cells_order)
_initial_topology(cells_dict::Dict{UUID,Cell}, cells_order::Vector{UUID}) =
Expand Down
1 change: 1 addition & 0 deletions src/webserver/Dynamic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ responses[:restart_process] = function response_restart_process(πŸ™‹::ClientRequ

if πŸ™‹.notebook.process_status != ProcessStatus.waiting_to_restart
πŸ™‹.notebook.process_status = ProcessStatus.waiting_to_restart
πŸ™‹.session.options.evaluation.run_notebook_on_load && _report_business_cells_planned!(πŸ™‹.notebook)
send_notebook_changes!(πŸ™‹ |> without_initiator)

SessionActions.shutdown(πŸ™‹.session, πŸ™‹.notebook; keep_in_session=true, async=true)
Expand Down
8 changes: 1 addition & 7 deletions src/webserver/SessionActions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,8 @@ function open(session::ServerSession, path::AbstractString;

session.notebooks[notebook.notebook_id] = notebook

run_status = Status.report_business_planned!(notebook.status_tree, :run)
if session.options.evaluation.run_notebook_on_load
Status.report_business_planned!(run_status, :resolve_topology)
cell_status = Status.report_business_planned!(run_status, :evaluate)
for (i,c) in enumerate(notebook.cells)
c.queued = true
Status.report_business_planned!(cell_status, Symbol(i))
end
_report_business_cells_planned!(notebook)
end

update_save_run!(session, notebook, notebook.cells; run_async, prerender_text=true)
Expand Down

0 comments on commit 88408eb

Please sign in to comment.