From b2442f4d913f9df42f8a094ed6579c0b171dac0d Mon Sep 17 00:00:00 2001 From: zosimovaa Date: Sat, 21 Feb 2026 22:53:52 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=82=D0=B8=D0=BF=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- src/config_manager/v1/cfg_manager.py | 4 ++-- src/config_manager/v2/control/telegram.py | 2 +- src/config_manager/v2/core/manager.py | 4 ++-- src/config_manager/v2/core/scheduler.py | 2 +- src/config_manager/v2/management/health_aggregator.py | 2 +- src/config_manager/v2/management/management_server.py | 2 +- src/config_manager/v2/types.py | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6ee6acb..0eb0f07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "config_manager" -version = "2.1.1" +version = "2.1.2" description = "Изменена логика задания таймаутов ожидания" authors = [ { name = "Aleksei Zosimov", email = "lesha.spb@gmail.com" } diff --git a/src/config_manager/v1/cfg_manager.py b/src/config_manager/v1/cfg_manager.py index 4442954..6e5ef18 100644 --- a/src/config_manager/v1/cfg_manager.py +++ b/src/config_manager/v1/cfg_manager.py @@ -9,8 +9,8 @@ from typing import Any, Optional from .log_manager import LogManager class ConfigManager: - DEFAULT_UPDATE_INTERVAL = 5.0 - DEFAULT_WORK_INTERVAL = 2.0 + DEFAULT_UPDATE_INTERVAL = 5 + DEFAULT_WORK_INTERVAL = 2 def __init__(self, path: str, log_manager: Optional[LogManager] = None): self.path = path diff --git a/src/config_manager/v2/control/telegram.py b/src/config_manager/v2/control/telegram.py index e88522c..dbfaca7 100644 --- a/src/config_manager/v2/control/telegram.py +++ b/src/config_manager/v2/control/telegram.py @@ -18,7 +18,7 @@ class TelegramControlChannel(ControlChannel): self, token: str, chat_id: int, - poll_interval: float = 2.0, + poll_interval: int = 2, logger: Optional[logging.Logger] = None, ): """Инициализация канала опроса Telegram с настройками бота и чата.""" diff --git a/src/config_manager/v2/core/manager.py b/src/config_manager/v2/core/manager.py index 1948cb2..b2582d3 100644 --- a/src/config_manager/v2/core/manager.py +++ b/src/config_manager/v2/core/manager.py @@ -22,8 +22,8 @@ from .scheduler import WorkerLoop class ConfigManagerV2: - DEFAULT_UPDATE_INTERVAL = 5.0 - DEFAULT_WORK_INTERVAL = 2.0 + DEFAULT_UPDATE_INTERVAL = 5 + DEFAULT_WORK_INTERVAL = 2 def __init__( self, diff --git a/src/config_manager/v2/core/scheduler.py b/src/config_manager/v2/core/scheduler.py index 8ac1342..50a684b 100644 --- a/src/config_manager/v2/core/scheduler.py +++ b/src/config_manager/v2/core/scheduler.py @@ -12,7 +12,7 @@ class WorkerLoop: def __init__( self, execute: Callable[[], None], - get_interval: Callable[[], float], + get_interval: Callable[[], int | float], halt_event: asyncio.Event, on_error: Optional[Callable[[Exception], None]] = None, on_success: Optional[Callable[[], None]] = None, diff --git a/src/config_manager/v2/management/health_aggregator.py b/src/config_manager/v2/management/health_aggregator.py index 6bfbb1b..731da17 100644 --- a/src/config_manager/v2/management/health_aggregator.py +++ b/src/config_manager/v2/management/health_aggregator.py @@ -17,7 +17,7 @@ class HealthAggregator: get_state: Callable[[], LifecycleState], get_last_error: Callable[[], str | None], get_last_success_timestamp: Callable[[], float | None], - health_timeout: float, + health_timeout: int, get_app_health: Callable[[], HealthPayload], ): self._get_state = get_state diff --git a/src/config_manager/v2/management/management_server.py b/src/config_manager/v2/management/management_server.py index bd27c8e..aa8c8d7 100644 --- a/src/config_manager/v2/management/management_server.py +++ b/src/config_manager/v2/management/management_server.py @@ -25,7 +25,7 @@ class ManagementServer: self, host: str, port: int, - timeout: float, + timeout: int, health_provider: Callable[[], Awaitable[HealthPayload]], on_start: Optional[Callable[[], Awaitable[str]]] = None, on_stop: Optional[Callable[[], Awaitable[str]]] = None, diff --git a/src/config_manager/v2/types.py b/src/config_manager/v2/types.py index 7e528c0..ba9c6ec 100644 --- a/src/config_manager/v2/types.py +++ b/src/config_manager/v2/types.py @@ -32,9 +32,9 @@ class ManagementServerSettings: enabled: bool = False host: str = "0.0.0.0" port: int = 8000 - timeout: float = 3.0 + timeout: int = 3 """Таймаут запроса health (секунды).""" - health_timeout: float = 30.0 + health_timeout: int = 30 """Секунды без успешного execute(), после которых health = unhealthy."""