mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-09-27 03:30:51 -04:00
Improved ratchet persist reliability
This commit is contained in:
parent
65b1667ae7
commit
af46e98865
1 changed files with 2 additions and 1 deletions
|
@ -216,9 +216,10 @@ class Destination:
|
||||||
ratchets_file = open(temp_write_path, "wb")
|
ratchets_file = open(temp_write_path, "wb")
|
||||||
ratchets_file.write(umsgpack.packb(persisted_data))
|
ratchets_file.write(umsgpack.packb(persisted_data))
|
||||||
ratchets_file.close()
|
ratchets_file.close()
|
||||||
os.unlink(self.ratchets_path)
|
if os.path.isfile(self.ratchets_path): os.unlink(self.ratchets_path)
|
||||||
os.rename(temp_write_path, self.ratchets_path)
|
os.rename(temp_write_path, self.ratchets_path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
RNS.trace_exception(e)
|
||||||
self.ratchets = None
|
self.ratchets = None
|
||||||
self.ratchets_path = None
|
self.ratchets_path = None
|
||||||
raise OSError("Could not write ratchet file contents for "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
|
raise OSError("Could not write ratchet file contents for "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue