Skip to content

Commit

Permalink
Make hosted app more robust (don't crash on exceptions)
Browse files Browse the repository at this point in the history
  • Loading branch information
essenciary committed Feb 29, 2024
1 parent c9772c2 commit 4df2740
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GenieBuilder"
uuid = "c9453c14-af8a-11ec-351d-c7c9a2035d70"
authors = ["Adrian Salceanu"]
version = "0.16.50"
version = "0.16.63"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
24 changes: 14 additions & 10 deletions app/resources/applications/ApplicationsController.jl
Original file line number Diff line number Diff line change
Expand Up @@ -503,16 +503,20 @@ function start(app::Application)
Core.eval(Main, :(const UserApp = $(@__MODULE__)));
Genie.genie(context = @__MODULE__);
up(; async = true,
open_browser = (ENV["GENIE_OPEN_BROWSER"] == "true"),
query = Dict("CHANNEL__" => ENV["GENIE_CHANNEL"])
); # end up
while true
revise()
Genie.HTTPUtils.HTTP.get("http://$(ENV["GENIE_HOST"]):$(ENV["PORT"])/?CHANNEL__=$(ENV["GENIE_CHANNEL"])");
revise()
sleep(1)
try
up(; async = true,
open_browser = (ENV["GENIE_OPEN_BROWSER"] == "true"),
query = Dict("CHANNEL__" => ENV["GENIE_CHANNEL"])
); # end up
while true
revise()
Genie.HTTPUtils.HTTP.get("http://$(ENV["GENIE_HOST"]):$(ENV["PORT"])/?CHANNEL__=$(ENV["GENIE_CHANNEL"])");
revise()
sleep(1)
end
catch ex
@error ex
end
'`; dir = fullpath(app), detach = false)
cmd = addenv(cmd, "PORT" => Base.get(ENV, "GB_APP_PORT", app.port),
Expand Down

0 comments on commit 4df2740

Please sign in to comment.