summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-09-07 16:58:09 -0400
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-09-07 16:58:09 -0400
commit4c32ddbf3dbda730ef80cba433497ee2e695266d (patch)
tree12df26d930ea64a89fd2a5c3ee334ed54cb495e5
parent964ff89f55aff5b45ee30ee4f5ccd4c2e5a64443 (diff)
combox.events: fixes a dropbox specific issue.
-rw-r--r--combox/events.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/combox/events.py b/combox/events.py
index 766b4e6..49a1c15 100644
--- a/combox/events.py
+++ b/combox/events.py
@@ -386,11 +386,14 @@ class NodeDirMonitor(LoggingEventHandler):
print "Okay, %s (%s) was actually modified." % (cb_filename,
event.dest_path)
self.silo.node_rem('file_deleted', cb_filename)
- # Next watchdog detects that the shard was modified
- # and generates calls the on_modified method. So we
- # don't have to store information in the silo about
- # this shard being modified; we do that later in the
- # on_modified method.
+ 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)
return