diff options
Diffstat (limited to 'combox/events.py')
-rw-r--r-- | combox/events.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/combox/events.py b/combox/events.py index bf9ad1d..fa47ceb 100644 --- a/combox/events.py +++ b/combox/events.py @@ -81,7 +81,10 @@ class ComboxDirMonitor(LoggingEventHandler): print "Thanks for your patience." # Remove information about files that were deleted. - for fpath in self.silo.keys(): + fpath_filter = lambda x: x not in self.silo.nodedicts() + fpaths = filter(fpath_filter, self.silo.keys()) + + for fpath in fpaths: if not path.exists(fpath): # remove this file's info from silo. print fpath, "was deleted. Removing it from DB." @@ -238,7 +241,11 @@ class NodeDirMonitor(LoggingEventHandler): # Remove files from the combox directory whose shards were # deleted. - for fpath in self.silo.keys(): + # Remove information about files that were deleted. + fpath_filter = lambda x: x not in self.silo.nodedicts() + fpaths = filter(fpath_filter, self.silo.keys()) + + for fpath in fpaths: fshards = node_paths(fpath, self.config, True) for fshard in fshards: |