mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-12-17 06:44:21 +01:00
Persist directory to disk for every user modification
This commit is contained in:
@@ -47,6 +47,7 @@ class Directory:
|
||||
file = open(self.app.directorypath, "wb")
|
||||
file.write(msgpack.packb(directory))
|
||||
file.close()
|
||||
|
||||
except Exception as e:
|
||||
RNS.log("Could not write directory to disk. Then contained exception was: "+str(e), RNS.LOG_ERROR)
|
||||
|
||||
@@ -179,6 +180,8 @@ class Directory:
|
||||
node_entry = self.directory_entries[associated_node]
|
||||
node_entry.trust_level = entry.trust_level
|
||||
|
||||
self.save_to_disk()
|
||||
|
||||
def forget(self, source_hash):
|
||||
if source_hash in self.directory_entries:
|
||||
self.directory_entries.pop(source_hash)
|
||||
|
||||
Reference in New Issue
Block a user