Skip to content

Commit 3fcf950

Browse files
Warning if command goes to queue
1 parent d9175e3 commit 3fcf950

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

moler/command_scheduler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,23 @@
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
1010
import threading
1111
import time
1212
from threading import Thread
1313

14+
from moler.connection_observer import ConnectionObserver
1415
from moler.exceptions import CommandTimeout
1516

1617

1718
class CommandScheduler:
1819
"""Scheduler for commands and events."""
1920

2021
@staticmethod
21-
def enqueue_starting_on_connection(connection_observer):
22+
def enqueue_starting_on_connection(connection_observer: ConnectionObserver):
2223
"""
2324
Wait for free slot and runs command when no other command is in run mode.
2425
@@ -43,6 +44,7 @@ def enqueue_starting_on_connection(connection_observer):
4344
)
4445
t1.daemon = True
4546
t1.start()
47+
connection_observer.logger.warning(f"Requested to execute command ({connection_observer}) but the other command is running. Waiting for a free slot.")
4648

4749
@staticmethod
4850
def dequeue_running_on_connection(connection_observer):

0 commit comments

Comments
 (0)