From 58fe9f9f0eb9e88499eeaf498b98c7cd16841c10 Mon Sep 17 00:00:00 2001 From: Mindaugas Date: Wed, 10 May 2023 15:11:31 +0300 Subject: [PATCH] Reduce lock time for tracking Batch and Session apps (#485) --- .../com/exacaster/lighter/application/batch/BatchHandler.java | 2 +- .../exacaster/lighter/application/sessions/SessionHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/exacaster/lighter/application/batch/BatchHandler.java b/server/src/main/java/com/exacaster/lighter/application/batch/BatchHandler.java index 5308cef8..984a3615 100644 --- a/server/src/main/java/com/exacaster/lighter/application/batch/BatchHandler.java +++ b/server/src/main/java/com/exacaster/lighter/application/batch/BatchHandler.java @@ -78,7 +78,7 @@ private Integer getMaxSlotsForNewJobs() { return maxSlotsForNewJobs; } - @SchedulerLock(name = "trackRunning") + @SchedulerLock(name = "trackRunning", lockAtMostFor = "1m") @Scheduled(fixedDelay = "30s") public void trackRunning() throws InterruptedException { assertLocked(); diff --git a/server/src/main/java/com/exacaster/lighter/application/sessions/SessionHandler.java b/server/src/main/java/com/exacaster/lighter/application/sessions/SessionHandler.java index 5ab11e21..849c37e3 100644 --- a/server/src/main/java/com/exacaster/lighter/application/sessions/SessionHandler.java +++ b/server/src/main/java/com/exacaster/lighter/application/sessions/SessionHandler.java @@ -92,7 +92,7 @@ private Waitable launchSession(Application session) { return launch(session, error -> statusTracker.processApplicationError(session, error)); } - @SchedulerLock(name = "trackRunningSessions") + @SchedulerLock(name = "trackRunningSessions", lockAtMostFor = "1m") @Scheduled(fixedRate = "2m") public void trackRunning() { assertLocked();