diff --git a/api/src/org/labkey/api/docker/DockerSessionListener.java b/api/src/org/labkey/api/docker/DockerSessionListener.java index 58a44855abe..9ef9db74141 100644 --- a/api/src/org/labkey/api/docker/DockerSessionListener.java +++ b/api/src/org/labkey/api/docker/DockerSessionListener.java @@ -48,7 +48,7 @@ public void valueUnbound(HttpSessionBindingEvent httpSessionBindingEvent) try { - DockerService.get().stop(_containerId); + stopContainer(_containerId); } catch (Exception ex) { @@ -57,4 +57,13 @@ public void valueUnbound(HttpSessionBindingEvent httpSessionBindingEvent) } protected void preStop() {} + + /** + * Override to route the stop through a service-specific manager (e.g. DockerRStudioManager) when one tracks + * its own cache of containers; the default here stops via DockerService directly, leaving such a cache stale. + */ + protected void stopContainer(@NotNull String containerId) + { + DockerService.get().stop(containerId); + } }