Skip to content

Commit

Permalink
run_git_directory: detect change to Project.toml or Manifest.toml and…
Browse files Browse the repository at this point in the history
… restart server (#112)
  • Loading branch information
fonsp authored Apr 27, 2023
1 parent 515e9be commit 0aa20ab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/PlutoSliderServer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,10 @@ function run_git_directory(
kwargs...,
)
end
old_deps = Pkg.dependencies()
pull_loop_task = Pluto.@asynclog while true
new_settings = get_settings()
new_deps = Pkg.dependencies()

if old_settings != new_settings
@error "Configuration changed. Shutting down!"
Expand All @@ -464,8 +466,11 @@ function run_git_directory(
println(stderr, "New settings:")
println(stderr, repr(new_settings))

# @ignorefailure schedule(run_dir_task[], InterruptException(); error=true)
exit()
exit() # this should trigger a restart, using the new settings
end
if old_deps != new_deps
@error "Package environment changed. Shutting down!"
exit() # this should trigger a restart, using the new settings
end

sleep(5)
Expand Down

0 comments on commit 0aa20ab

Please sign in to comment.