diff --git a/deker/locks.py b/deker/locks.py index ac1053a..5aaa723 100644 --- a/deker/locks.py +++ b/deker/locks.py @@ -323,7 +323,7 @@ def check_existing_lock(self, func_args: Sequence, func_kwargs: Dict) -> None: # Iterate over Arrays in VArray and try to lock them. If locking fails - wait. # If it fails again - release all locks. currently_locked = self.check_arrays_locks(arrays_positions, adapter, varray) - if not currently_locked and (len(self.locks) == len(arrays_positions)): + if not currently_locked: # Release array locks return diff --git a/deker/log.py b/deker/log.py index bd18745..b0f6d7f 100644 --- a/deker/log.py +++ b/deker/log.py @@ -13,19 +13,18 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . - import logging -import os -from logging import Logger +from typing import Optional + _ROOT_DEKER_LOGGER_NAME = "Deker" -_level = os.getenv("DEKER_LOGLEVEL", "WARNING") format_string = "%(levelname)s | %(asctime)s | %(name)s | %(message)s" fmter = logging.Formatter(fmt=format_string) _logger = logging.getLogger(_ROOT_DEKER_LOGGER_NAME) +_logger.propagate = False _handler = logging.StreamHandler() _handler.setFormatter(fmter) _logger.addHandler(_handler) @@ -34,10 +33,10 @@ class SelfLoggerMixin(object): """Mixin with a logger object with a possibility to log its actions.""" - __logger: Logger = None + __logger: Optional[logging.Logger] = None @property - def logger(self) -> Logger: + def logger(self) -> logging.Logger: """Lazy deker logger property.""" if not self.__logger: self.__logger = _logger.getChild(self.__class__.__name__)