From edd9a5f6976fccfbc10100d4a7b2ddec4a066e2e Mon Sep 17 00:00:00 2001 From: Nikita Reznikov Date: Thu, 13 Jun 2024 19:30:23 +0300 Subject: [PATCH] Fix issue with negative seconds to sleep in time input plugin --- eventum_plugins/input/timer.py | 3 ++- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/eventum_plugins/input/timer.py b/eventum_plugins/input/timer.py index bd218db..ca80850 100644 --- a/eventum_plugins/input/timer.py +++ b/eventum_plugins/input/timer.py @@ -36,7 +36,8 @@ def live(self, on_event: Callable[[datetime64], Any]) -> None: timestamp - get_now(tz=self._tz) ) - time.sleep(sleep_seconds) # type: ignore[arg-type] + if sleep_seconds > 0: + time.sleep(sleep_seconds) # type: ignore[arg-type] for _ in range(self._count): on_event(timestamp) diff --git a/pyproject.toml b/pyproject.toml index bb4bdd9..a31a29d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "eventum-plugins" -version = "1.0.7" +version = "1.0.8" description = "Plugins for Eventum" license = "Apache-2.0" authors = ["Nikita Reznikov "]