summaryrefslogtreecommitdiff
path: root/kvmd/plugins/hid/otg/device.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-10-03 10:06:04 +0300
committerDevaev Maxim <[email protected]>2020-10-03 10:06:04 +0300
commit2b2014f7b1c638184ab691fbf0821e61ce7237aa (patch)
tree04430ef0238a5462dd763d590fbe470bb1337385 /kvmd/plugins/hid/otg/device.py
parent877a0b844100c51ff96f19f4a00abed02dadec89 (diff)
adjust reopen delay
Diffstat (limited to 'kvmd/plugins/hid/otg/device.py')
-rw-r--r--kvmd/plugins/hid/otg/device.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/kvmd/plugins/hid/otg/device.py b/kvmd/plugins/hid/otg/device.py
index 08777293..625aeef5 100644
--- a/kvmd/plugins/hid/otg/device.py
+++ b/kvmd/plugins/hid/otg/device.py
@@ -57,6 +57,7 @@ class BaseDeviceProcess(multiprocessing.Process): # pylint: disable=too-many-in
select_timeout: float,
write_retries: int,
write_retries_delay: float,
+ reopen_delay: float,
noop: bool,
) -> None:
@@ -71,6 +72,7 @@ class BaseDeviceProcess(multiprocessing.Process): # pylint: disable=too-many-in
self.__select_timeout = select_timeout
self.__write_retries = write_retries
self.__write_retries_delay = write_retries_delay
+ self.__reopen_delay = reopen_delay
self.__noop = noop
self.__fd = -1
@@ -230,13 +232,13 @@ class BaseDeviceProcess(multiprocessing.Process): # pylint: disable=too-many-in
self.__fd = os.open(self.__device_path, flags)
except FileNotFoundError:
logger.error("Missing HID-%s device: %s", self.__name, self.__device_path)
- time.sleep(self.__select_timeout)
+ time.sleep(self.__reopen_delay)
except Exception as err:
logger.error("Can't open HID-%s device: %s: %s: %s",
self.__name, self.__device_path, type(err).__name__, err)
- time.sleep(self.__select_timeout)
+ time.sleep(self.__reopen_delay)
else:
- time.sleep(self.__select_timeout)
+ time.sleep(self.__reopen_delay)
if self.__fd >= 0:
try: