From 06d54f397096771ce3655c62a46f9413a6430369 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Wed, 4 Sep 2019 19:19:49 +0200 Subject: [PATCH] Remove network manager re-creation that was causing issues --- cura/PrinterOutput/NetworkedPrinterOutputDevice.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py index e23341ba8a..392df7bded 100644 --- a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py +++ b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py @@ -35,8 +35,6 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice): def __init__(self, device_id, address: str, properties: Dict[bytes, bytes], connection_type: ConnectionType = ConnectionType.NetworkConnection, parent: QObject = None) -> None: super().__init__(device_id = device_id, connection_type = connection_type, parent = parent) self._manager = None # type: Optional[QNetworkAccessManager] - self._last_manager_create_time = None # type: Optional[float] - self._recreate_network_manager_time = 30 self._timeout_time = 10 # After how many seconds of no response should a timeout occur? self._last_response_time = None # type: Optional[float] @@ -133,12 +131,6 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice): self.setConnectionState(ConnectionState.Closed) - # We need to check if the manager needs to be re-created. If we don't, we get some issues when OSX goes to - # sleep. - if time_since_last_response > self._recreate_network_manager_time: - if self._last_manager_create_time is None or time() - self._last_manager_create_time > self._recreate_network_manager_time: - self._createNetworkManager() - assert(self._manager is not None) elif self._connection_state == ConnectionState.Closed: # Go out of timeout. if self._connection_state_before_timeout is not None: # sanity check, but it should never be None here @@ -317,7 +309,6 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice): self._manager = QNetworkAccessManager() self._manager.finished.connect(self._handleOnFinished) - self._last_manager_create_time = time() self._manager.authenticationRequired.connect(self._onAuthenticationRequired) if self._properties.get(b"temporary", b"false") != b"true":