Return early when starting/stopping if not in expected state.

This commit is contained in:
akwizgran
2022-06-09 18:01:32 +01:00
parent 85d1addd04
commit de3a87fff5
3 changed files with 115 additions and 63 deletions

View File

@@ -37,8 +37,14 @@ public interface LifecycleManager {
*/
enum LifecycleState {
STARTING, MIGRATING_DATABASE, COMPACTING_DATABASE, STARTING_SERVICES,
RUNNING, STOPPING;
CREATED,
STARTING,
MIGRATING_DATABASE,
COMPACTING_DATABASE,
STARTING_SERVICES,
RUNNING,
STOPPING,
STOPPED;
public boolean isAfter(LifecycleState state) {
return ordinal() > state.ordinal();