summaryrefslogtreecommitdiffstats
path: root/combox/events.py
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-08-25 23:23:31 -0400
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-08-25 23:23:31 -0400
commitd5b52030348d40600b4c9256f76e5183a85fbb17 (patch)
treed0a1eeebd22ef7ef09da578b598d598b53873ae2 /combox/events.py
parentcd2900ad565fd4e77c68607aabc819184f4ffc06 (diff)
bug fix (b#4).
modified: TODO.org modified: combox/events.py
Diffstat (limited to 'combox/events.py')
-rw-r--r--combox/events.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/combox/events.py b/combox/events.py
index 4695c00..c0bc224 100644
--- a/combox/events.py
+++ b/combox/events.py
@@ -29,7 +29,7 @@ from combox.crypto import split_and_encrypt, decrypt_and_glue
from combox.file import (mk_nodedir, rm_nodedir, rm_shards,
relative_path, move_shards, move_nodedir,
cb_path, node_path, hash_file, rm_path,
- node_paths)
+ node_paths, no_of_shards)
from combox.silo import ComboxSilo
@@ -397,6 +397,13 @@ class NodeDirMonitor(LoggingEventHandler):
file_cb_path = cb_path(event.src_path, self.config)
+ # get no. shards available
+ shards_there = no_of_shards(file_cb_path, self.config)
+
+ if shards_there != self.num_nodes:
+ # got to wait for other shards to arrive!
+ return
+
if event.is_directory:
# do nothing
pass