Skip to content

Commit

Permalink
feat: A shutting down state in ShutdownHandler (#1454)
Browse files Browse the repository at this point in the history
### Motivation
Before this PR, there was no way of figuring if cloudnet is shutting
down or not outside of internal cloudnet packages (without using
reflections), causing custom load balancing modules unable to determine
whether it should start new services.

### Modification
This PR exposes a proper function to determine whether a shutdown is in
progress or not.

### Result
Custom modules can now determine whether cloudnet is shutting down or
not
  • Loading branch information
RobotHanzo authored Jul 14, 2024
1 parent 8f0db31 commit 1ab0a72
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions node/src/main/java/eu/cloudnetservice/node/TickLoop.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ public TickLoop(
return task;
}

public boolean running() {
return RUNNING.get();
}

public void pause() {
this.tickPauseRequests.incrementAndGet();
}
Expand Down

0 comments on commit 1ab0a72

Please sign in to comment.