mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +01:00
Handle processing case for the schedule leader process lock when it's empty
This commit is contained in:
parent
faf3584acd
commit
7d3a25f8c0
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue