Shut down command dependencies in LIFO order

This commit is contained in:
Jon Chambers
2025-12-02 11:30:18 -05:00
committed by Jon Chambers
parent 4af50986e0
commit 92e133b21f

View File

@@ -58,7 +58,7 @@ public abstract class AbstractCommandWithDependencies extends EnvironmentCommand
} finally {
logger.info("Stopping command dependencies");
environment.lifecycle().getManagedObjects().forEach(managedObject -> {
environment.lifecycle().getManagedObjects().reversed().forEach(managedObject -> {
try {
managedObject.stop();
} catch (final Exception e) {