Fix init
This commit is contained in:
@@ -53,6 +53,13 @@ class MessageProcessor:
|
|||||||
self._dropped_count = 0
|
self._dropped_count = 0
|
||||||
self._queue_full_warnings = 0
|
self._queue_full_warnings = 0
|
||||||
|
|
||||||
|
# Инициализируем обработчики
|
||||||
|
if handlers is None:
|
||||||
|
handlers = self._create_default_handlers()
|
||||||
|
|
||||||
|
self.handlers: List[BaseHandler] = []
|
||||||
|
self._init_handlers(handlers)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def processed_count(self) -> int:
|
def processed_count(self) -> int:
|
||||||
with self._stats_lock:
|
with self._stats_lock:
|
||||||
@@ -77,13 +84,6 @@ class MessageProcessor:
|
|||||||
self._dropped_count += count
|
self._dropped_count += count
|
||||||
self._queue_full_warnings += count
|
self._queue_full_warnings += count
|
||||||
|
|
||||||
# Инициализируем обработчики
|
|
||||||
if handlers is None:
|
|
||||||
handlers = self._create_default_handlers()
|
|
||||||
|
|
||||||
self.handlers: List[BaseHandler] = []
|
|
||||||
self._init_handlers(handlers)
|
|
||||||
|
|
||||||
def _create_default_handlers(self) -> List[BaseHandler]:
|
def _create_default_handlers(self) -> List[BaseHandler]:
|
||||||
"""
|
"""
|
||||||
Создание обработчиков по умолчанию из конфигурации.
|
Создание обработчиков по умолчанию из конфигурации.
|
||||||
|
|||||||
Reference in New Issue
Block a user