Skip to content

Commit 78dfd84

Browse files
Warning if command goes to queue (#579)
* Warning if command goes to queue * import * dev
1 parent d9175e3 commit 78dfd84

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

moler/command_scheduler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Scheduler for commands and events."""
44

55
__author__ = "Marcin Usielski"
6-
__copyright__ = "Copyright (C) 2019-2023, Nokia"
6+
__copyright__ = "Copyright (C) 2019-2025, Nokia"
77
__email__ = "[email protected]"
88

99
import logging
@@ -43,6 +43,8 @@ def enqueue_starting_on_connection(connection_observer):
4343
)
4444
t1.daemon = True
4545
t1.start()
46+
connection_observer._log(logging.WARNING, f"Requested to execute command ({connection_observer}) but the other "
47+
"command is running. Waiting for a free slot.")
4648

4749
@staticmethod
4850
def dequeue_running_on_connection(connection_observer):

moler/connection_observer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""Base class for all events and commands that are to be observed on connection."""
44

55
__author__ = "Grzegorz Latuszek, Marcin Usielski, Michal Ernst"
6-
__copyright__ = "Copyright (C) 2018-2024 Nokia"
6+
__copyright__ = "Copyright (C) 2018-2025 Nokia"
77
__email__ = (
88
99
)
@@ -546,7 +546,7 @@ def get_short_desc(self) -> str:
546546
"""
547547
return f"Observer '{self.__class__.__module__}.{self}'"
548548

549-
def _log(self, lvl: int, msg: str, extra: dict = None, levels_to_go_up: int = 1) -> None:
549+
def _log(self, lvl: int, msg: str, extra: Optional[dict] = None, levels_to_go_up: int = 1) -> None:
550550
"""
551551
Log a message with the specified level.
552552

0 commit comments

Comments
 (0)