From 6576d887588f1c89e4fdb0e7a64fde8bc6967af7 Mon Sep 17 00:00:00 2001 From: Adrian Salceanu Date: Fri, 1 Dec 2023 14:01:16 +0100 Subject: [PATCH] Only load @genietools once --- Project.toml | 2 +- src/GenieFramework.jl | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Project.toml b/Project.toml index 7be4bdd..9e9bcd1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GenieFramework" uuid = "a59fdf5c-6bf0-4f5d-949c-a137c9e2f353" authors = ["Adrian Salceanu and contributors"] -version = "1.26.3" +version = "1.26.4" [deps] GarishPrint = "b0ab02a7-8576-43f7-aa76-eaa7c3897c54" diff --git a/src/GenieFramework.jl b/src/GenieFramework.jl index d63fc7e..f9ec5ee 100644 --- a/src/GenieFramework.jl +++ b/src/GenieFramework.jl @@ -56,11 +56,6 @@ which can be accessed from `app_host:app_port/geniepackagemanager` etc. """ macro genietools() return quote - Genie.Loader.bootstrap(@__MODULE__; show_banner = false) - Stipple.__init__() - StippleUI.__init__() - StipplePlotly.__init__() - function __genietools() Genie.config.log_to_file = true Genie.config.log_requests = false @@ -115,7 +110,19 @@ macro genietools() nothing end - __genietools() + if ! isdefined(Main, :GENIE_TOOLS_LOADED) + const GENIE_TOOLS_LOADED = true + @info "Loading GenieTools" + + Genie.Loader.bootstrap(@__MODULE__; show_banner = false) + Stipple.__init__() + StippleUI.__init__() + StipplePlotly.__init__() + + __genietools() + else + @warn "GenieTools already loaded, skipping" + end end |> esc end