From f024a16d6f689d2ad4ed3420b58e78ffe88e94ae Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Fri, 13 Mar 2015 12:48:48 -0400 Subject: updated on_created, on_modified, on_deleted methods in NodeDirMonitor. Now they check if the event.src_path is a shard or a directory before doing anything. modified: combox/events.py --- combox/events.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/combox/events.py b/combox/events.py index 973a79d..5cdd54f 100644 --- a/combox/events.py +++ b/combox/events.py @@ -240,6 +240,11 @@ class NodeDirMonitor(LoggingEventHandler): super(NodeDirMonitor, self).on_created(event) self.silo_update() + if not self.shardp(event.src_path) and not event.is_directory: + # the file created can be ignored as it is not a shard or + # a directory. + return + file_cb_path = cb_path(event.src_path, self.config) if event.is_directory and (not path.exists(file_cb_path)): @@ -262,6 +267,11 @@ class NodeDirMonitor(LoggingEventHandler): super(NodeDirMonitor, self).on_deleted(event) self.silo_update() + if not self.shardp(event.src_path) and not event.is_directory: + # the file created can be ignored as it is not a shard or + # a directory. + return + file_cb_path = cb_path(event.src_path, self.config) if event.is_directory: @@ -278,6 +288,11 @@ class NodeDirMonitor(LoggingEventHandler): super(NodeDirMonitor, self).on_modified(event) self.silo_update() + if not self.shardp(event.src_path) and not event.is_directory: + # the file created can be ignored as it is not a shard or + # a directory. + return + file_cb_path = cb_path(event.src_path, self.config) if event.is_directory: -- cgit v1.2.3