summaryrefslogtreecommitdiffstats
path: root/combox/events.py
diff options
context:
space:
mode:
Diffstat (limited to 'combox/events.py')
-rw-r--r--combox/events.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/combox/events.py b/combox/events.py
index 609ed8e..bc6fe8b 100644
--- a/combox/events.py
+++ b/combox/events.py
@@ -373,6 +373,11 @@ class NodeDirMonitor(LoggingEventHandler):
# means, file was modified on another computer (also
# running combox). so, reconstruct the file and put it
# in the combox directory.
- decrypt_and_glue(file_cb_path, self.config)
- # update db.
- self.silo.update(file_cb_path)
+ with self.lock:
+ self.silo.node_set('file_modified', file_cb_path)
+ num = self.silo.node_get('file_modified', file_cb_path)
+ if num == self.num_nodes:
+ decrypt_and_glue(file_cb_path, self.config)
+ # update db.
+ self.silo.update(file_cb_path)
+ self.silo.node_rem('file_modified', file_cb_path)