Skip to content
Snippets Groups Projects
Commit c276e892 authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-391: Obtain proxies in separate thread because it may stall

parent 50f4f959
No related branches found
No related tags found
No related merge requests found
......@@ -60,6 +60,7 @@ class DevicesInitialiser(Thread):
self.ignore_unavailable_devices = ignore_unavailable_devices
self.device_names = device_names
self.proxy_timeout = proxy_timeout
# setup initial state
self.progress = 0
......@@ -79,16 +80,19 @@ class DevicesInitialiser(Thread):
self.devices[name] = DeviceProxy(name)
# set the timeout for all proxies
self.set_status("Configuring DeviceProxies")
for device in self.devices.values():
device.set_timeout_millis(int(proxy_timeout * 1000))
self.initialise_devices()
device.set_timeout_millis(int(self.proxy_timeout * 1000))
self.set_status("Initialisation started")
self.initialise_devices()
self.set_status("Initialisation completed")
except Exception as e:
logger.exception("Failed to initialise station")
# add the exception to the status
self.set_status(f"{self.status} [{e.__class__.__name__}: {str(e)}]")
self.set_status(f"ERROR: {self.status} [{e.__class__.__name__}: {str(e)}]")
# we keep the status stuck at the last thing it tried
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment