Show lock clean up message

This commit is contained in:
yangdx 2025-07-12 02:58:05 +08:00
parent 22c36f2fd2
commit 3d8e6924bc

View file

@ -341,10 +341,11 @@ def _release_shared_raw_mp_lock(factory_name: str, key: str):
_lock_registry_count.pop(cleanup_key, None) _lock_registry_count.pop(cleanup_key, None)
_lock_cleanup_data.pop(cleanup_key, None) _lock_cleanup_data.pop(cleanup_key, None)
cleaned_count += 1 cleaned_count += 1
if cleaned_count > 0:
direct_log( direct_log(
f"== mp Lock == Cleaned up {cleaned_count}/{total_cleanup_len} expired locks", f"== mp Lock == Cleaned up {cleaned_count}/{total_cleanup_len} expired locks",
enable_output=False, enable_output=False,
level="DEBUG", level="INFO",
) )
@ -423,10 +424,11 @@ class KeyedUnifiedLock:
self._async_lock_count.pop(cleanup_key) self._async_lock_count.pop(cleanup_key)
self._async_lock_cleanup_data.pop(cleanup_key) self._async_lock_cleanup_data.pop(cleanup_key)
cleaned_count += 1 cleaned_count += 1
if cleaned_count > 0:
direct_log( direct_log(
f"== async Lock == Cleaned up {cleaned_count}/{total_cleanup_len} expired async locks", f"== async Lock == Cleaned up {cleaned_count}/{total_cleanup_len} expired async locks",
enable_output=False, enable_output=False,
level="DEBUG", level="INFO",
) )
def _get_lock_for_key(self, key: str, enable_logging: bool = False) -> UnifiedLock: def _get_lock_for_key(self, key: str, enable_logging: bool = False) -> UnifiedLock: