mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-06 05:39:12 +00:00
Reduce log level of noisy process lock logs
This commit is contained in:
@@ -447,7 +447,7 @@ class ProcessLockAdapters:
|
|||||||
def run_with_lock(func: Callable, operation: ProcessLock.Operation, max_duration_in_seconds: int = 600, **kwargs):
|
def run_with_lock(func: Callable, operation: ProcessLock.Operation, max_duration_in_seconds: int = 600, **kwargs):
|
||||||
# Exit early if process lock is already taken
|
# Exit early if process lock is already taken
|
||||||
if ProcessLockAdapters.is_process_locked(operation):
|
if ProcessLockAdapters.is_process_locked(operation):
|
||||||
logger.info(f"🔒 Skip executing {func} as {operation} lock is already taken")
|
logger.debug(f"🔒 Skip executing {func} as {operation} lock is already taken")
|
||||||
return
|
return
|
||||||
|
|
||||||
success = False
|
success = False
|
||||||
@@ -462,7 +462,7 @@ class ProcessLockAdapters:
|
|||||||
func(**kwargs)
|
func(**kwargs)
|
||||||
success = True
|
success = True
|
||||||
except IntegrityError as e:
|
except IntegrityError as e:
|
||||||
logger.error(f"⚠️ Unable to create the process lock for {func} with {operation}: {e}")
|
logger.debug(f"⚠️ Unable to create the process lock for {func} with {operation}: {e}")
|
||||||
success = False
|
success = False
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"🚨 Error executing {func} with {operation} process lock: {e}", exc_info=True)
|
logger.error(f"🚨 Error executing {func} with {operation} process lock: {e}", exc_info=True)
|
||||||
@@ -475,7 +475,7 @@ class ProcessLockAdapters:
|
|||||||
f"🔓 Unlocked {operation} process after executing {func} {'Succeeded' if success else 'Failed'}"
|
f"🔓 Unlocked {operation} process after executing {func} {'Succeeded' if success else 'Failed'}"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
logger.info(f"Skip removing {operation} process lock as it was not set")
|
logger.debug(f"Skip removing {operation} process lock as it was not set")
|
||||||
|
|
||||||
|
|
||||||
def run_with_process_lock(*args, **kwargs):
|
def run_with_process_lock(*args, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user