Skip to content
Snippets Groups Projects
Commit 92097614 authored by François  LAURENT's avatar François LAURENT
Browse files

fix: frontend no longer crashes if backend is not available at startup

parent 509337a2
No related branches found
No related tags found
1 merge request!25Set of commits to be tagged v0.20.1
Pipeline #154961 passed
...@@ -14,7 +14,7 @@ docker=docker LARVATAGGER_IMAGE=flaur/larvatagger:$RELEASE-20230311 scripts/larv ...@@ -14,7 +14,7 @@ docker=docker LARVATAGGER_IMAGE=flaur/larvatagger:$RELEASE-20230311 scripts/larv
docker tag flaur/larvatagger:$RELEASE-20230311 flaur/larvatagger:latest docker tag flaur/larvatagger:$RELEASE-20230311 flaur/larvatagger:latest
docker build -t flaur/larvatagger:$RELEASE-bigfat -f recipes/Dockerfile.pasteurjanelia --no-cache . docker build -t flaur/larvatagger:$RELEASE-bigfat -f recipes/Dockerfile.pasteurjanelia --no-cache .
test/predict_and_retrain.sh #test/predict_and_retrain.sh
cat <<EOF cat <<EOF
Next steps are: Next steps are:
......
...@@ -219,6 +219,7 @@ end ...@@ -219,6 +219,7 @@ end
function listmodels(back::LTBackend, ::Val{true}) function listmodels(back::LTBackend, ::Val{true})
map(back.active_tagging_backend) do tagging_backend map(back.active_tagging_backend) do tagging_backend
models = OrderedDict{String, String}[] models = OrderedDict{String, String}[]
isnothing(tagging_backend) && return models
for name in keys(back.taggers[tagging_backend]) for name in keys(back.taggers[tagging_backend])
metadata = back.metadata[tagging_backend][:models][name] metadata = back.metadata[tagging_backend][:models][name]
push!(models, OrderedDict("name" => name, push!(models, OrderedDict("name" => name,
......
...@@ -51,7 +51,11 @@ function getbackends(controller, location=nothing) ...@@ -51,7 +51,11 @@ function getbackends(controller, location=nothing)
else else
if !isnothing(location) && startswith(location, "http://") if !isnothing(location) && startswith(location, "http://")
back = REST.Client.LTBackend(location) back = REST.Client.LTBackend(location)
REST.Client.connect(back; preselect_tagger=true) try
REST.Client.connect(back; preselect_tagger=true)
catch
@error "Failed to connect to backend"
end
controller[:backends] = back controller[:backends] = back
else else
backends = Backends(controller, location) backends = Backends(controller, location)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment