mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-05-13 03:12:16 -04:00
Persist directory to disk for every user modification
This commit is contained in:
parent
6df7feffe6
commit
ebfa6484a2
5 changed files with 11 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue