mirror of
https://github.com/liberatedsystems/Sideband_CE.git
synced 2024-09-03 04:13:27 +02:00
Added IPC retry
This commit is contained in:
parent
6767a707cd
commit
6eb10b566e
@ -1169,15 +1169,22 @@ class SidebandCore():
|
|||||||
self.state_db[prop] = val
|
self.state_db[prop] = val
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
try:
|
def set():
|
||||||
if self.rpc_connection == None:
|
if self.rpc_connection == None:
|
||||||
self.rpc_connection = multiprocessing.connection.Client(self.rpc_addr, authkey=self.rpc_key)
|
self.rpc_connection = multiprocessing.connection.Client(self.rpc_addr, authkey=self.rpc_key)
|
||||||
self.rpc_connection.send({"setstate": (prop, val)})
|
self.rpc_connection.send({"setstate": (prop, val)})
|
||||||
response = self.rpc_connection.recv()
|
response = self.rpc_connection.recv()
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
try:
|
||||||
|
set()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
RNS.log("Error while setting state over RPC: "+str(e), RNS.LOG_DEBUG)
|
RNS.log("Error while setting state over RPC: "+str(e)+". Retrying once.", RNS.LOG_DEBUG)
|
||||||
return False
|
try:
|
||||||
|
set()
|
||||||
|
except Exception as e:
|
||||||
|
RNS.log("Error on retry as well: "+str(e)+". Giving up.", RNS.LOG_DEBUG)
|
||||||
|
return False
|
||||||
|
|
||||||
def service_set_latest_telemetry(self, latest_telemetry, latest_packed_telemetry):
|
def service_set_latest_telemetry(self, latest_telemetry, latest_packed_telemetry):
|
||||||
if not RNS.vendor.platformutils.is_android():
|
if not RNS.vendor.platformutils.is_android():
|
||||||
|
Loading…
Reference in New Issue
Block a user