From cd7175383ec48b369a58b948ac408b9c9bb66ad2 Mon Sep 17 00:00:00 2001 From: eblondel Date: Mon, 28 Oct 2024 00:14:26 +0100 Subject: [PATCH] fix #394 --- inst/actions/geosapi_publish_ogc_services.R | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/inst/actions/geosapi_publish_ogc_services.R b/inst/actions/geosapi_publish_ogc_services.R index 97cb906..de3338d 100644 --- a/inst/actions/geosapi_publish_ogc_services.R +++ b/inst/actions/geosapi_publish_ogc_services.R @@ -416,6 +416,7 @@ function(action, entity, config){ #styles publication if needed gs_styles <- c(GS$getStyleNames(), GS$getStyleNames(ws = workspace)) if(data_object$styleUpload) if(length(data_object$styles)>0){ + reload_styles = FALSE for(i in 1:length(data_object$styles)){ style <- data_object$styles[i] #check if any style SLD file is available in source @@ -425,11 +426,14 @@ function(action, entity, config){ if(style_sldfile %in% data_object$source){ config$logger.info(sprintf("Creating GeoServer style '%s' from SLD style file '%s' available as source", style, style_sldfile)) created <- GS$createStyle(file = file.path(getwd(), "data", style_sldfile), name = style, ws = workspace) + if(created) reload_styles = TRUE } } } - GS$reload() - gs_styles <- c(GS$getStyleNames(), GS$getStyleNames(ws = workspace)) + if(reload_styles){ + GS$reload() + gs_styles <- c(GS$getStyleNames(), GS$getStyleNames(ws = workspace)) + } } #layer build and publication