Setup lifecycle manager

This commit is contained in:
Andrei Isvoran 2024-07-03 13:14:09 +03:00
parent 6d45d9943c
commit 1d76ad3f86

View File

@ -16,8 +16,8 @@ import lombok.extern.slf4j.Slf4j;
@RequiredArgsConstructor
public class LifecycleManager implements SmartLifecycle, ApplicationListener<ContextClosedEvent> {
private volatile boolean running = false;
private volatile boolean shutdownInitiated = false;
private volatile boolean running; // by default initialized as false
private volatile boolean shutdownInitiated; // by default initialized as false
private final Object shutdownMonitor = new Object();
private final AtomicInteger activeTasks = new AtomicInteger(0);
private final CountDownLatch latch = new CountDownLatch(1);