From 7d3a25f8c05f359d247ad9b219da08b25e42ce75 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Fri, 9 Aug 2024 16:37:06 +0530 Subject: [PATCH] Handle processing case for the schedule leader process lock when it's empty --- src/khoj/configure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/khoj/configure.py b/src/khoj/configure.py index 8d9c4489..7c5bb4a3 100644 --- a/src/khoj/configure.py +++ b/src/khoj/configure.py @@ -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 )