Fix init
This commit is contained in:
@@ -53,6 +53,13 @@ class MessageProcessor:
|
||||
self._dropped_count = 0
|
||||
self._queue_full_warnings = 0
|
||||
|
||||
# Инициализируем обработчики
|
||||
if handlers is None:
|
||||
handlers = self._create_default_handlers()
|
||||
|
||||
self.handlers: List[BaseHandler] = []
|
||||
self._init_handlers(handlers)
|
||||
|
||||
@property
|
||||
def processed_count(self) -> int:
|
||||
with self._stats_lock:
|
||||
@@ -76,13 +83,6 @@ class MessageProcessor:
|
||||
with self._stats_lock:
|
||||
self._dropped_count += 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]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user