Skip to content

Commit

Permalink
reverse the order of services on shutdown
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Fukushima <[email protected]>
  • Loading branch information
gfukushima committed Jan 28, 2025
1 parent 07b70e2 commit d65b0fe
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package tech.pegasys.teku.services;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import tech.pegasys.teku.infrastructure.async.SafeFuture;
Expand All @@ -37,6 +38,8 @@ protected SafeFuture<?> doStart() {

@Override
protected SafeFuture<?> doStop() {
// Stop services in reverse order
Collections.reverse(services);
return SafeFuture.allOf(services.stream().map(Service::stop).toArray(SafeFuture[]::new));
}

Expand Down

0 comments on commit d65b0fe

Please sign in to comment.