diff --git a/src/main/java/org/gcube/smartgears/handlers/application/lifecycle/ApplicationProfileManager.java b/src/main/java/org/gcube/smartgears/handlers/application/lifecycle/ApplicationProfileManager.java index 2228dc7..683a4a9 100644 --- a/src/main/java/org/gcube/smartgears/handlers/application/lifecycle/ApplicationProfileManager.java +++ b/src/main/java/org/gcube/smartgears/handlers/application/lifecycle/ApplicationProfileManager.java @@ -117,7 +117,7 @@ public class ApplicationProfileManager extends ApplicationLifecycleHandler { //if we've failed before first publication do not try to publish //(we may well have failed there) - if (context.properties().contains(PUBLISHED_PROP)) { + if (!context.properties().contains(PUBLISHED_PROP)) { log.info("publishing application for the first time"); context.properties().add(new Property(PUBLISHED_PROP, true)); if (context.lifecycle().state() != ApplicationState.failed) { diff --git a/src/main/java/org/gcube/smartgears/handlers/container/lifecycle/ContainerProfileManager.java b/src/main/java/org/gcube/smartgears/handlers/container/lifecycle/ContainerProfileManager.java index 3f16126..c0eeb4d 100644 --- a/src/main/java/org/gcube/smartgears/handlers/container/lifecycle/ContainerProfileManager.java +++ b/src/main/java/org/gcube/smartgears/handlers/container/lifecycle/ContainerProfileManager.java @@ -104,7 +104,7 @@ public class ContainerProfileManager extends ContainerHandler { log.info("Publish after profile Change event called"); //if we've failed before first publication do not try to publish //(we may well have failed there) - if (context.properties().contains(PUBLISHED_PROP)) { + if (!context.properties().contains(PUBLISHED_PROP)) { context.properties().add(new Property(PUBLISHED_PROP, true)); log.info("publishing container for the first time"); if (context.lifecycle().state() != ContainerState.failed) { @@ -126,6 +126,7 @@ public class ContainerProfileManager extends ContainerHandler { log.error("cannot publish container with publisher type {} (see details)", p.getClass().getCanonicalName(), e); } }); + } @Observes(value = addToContext)