Handle processing case for the schedule leader process lock when it's empty

This commit is contained in:
sabaimran 2024-08-09 16:37:06 +05:30
parent faf3584acd
commit 7d3a25f8c0

View file

@ -430,7 +430,7 @@ def wakeup_scheduler():
schedule_leader_process_lock = ProcessLockAdapters.get_process_lock(ProcessLock.Operation.SCHEDULE_LEADER)
# Check if the process lock is still active. If not, create a new process lock. This worker will become the scheduler leader.
if not ProcessLockAdapters.is_process_locked(schedule_leader_process_lock):
if not schedule_leader_process_lock or not ProcessLockAdapters.is_process_locked(schedule_leader_process_lock):
schedule_leader_process_lock = ProcessLockAdapters.set_process_lock(
ProcessLock.Operation.SCHEDULE_LEADER, max_duration_in_seconds=TWELVE_HOURS
)