summaryrefslogtreecommitdiffstats
path: root/combox/events.py
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-04-01 11:06:50 -0400
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-04-01 11:06:50 -0400
commit43bcf032e6989430463907cc5cabeb6fcdb21648 (patch)
tree38e57b40e4becff60fc3707f4fe219754bc7fac6 /combox/events.py
parentc26b623447e14b81f42136b79ad88b1c9b24e207 (diff)
Now combox.silo.ComboxSilo reloads db from disk before reading/writing.
modified: combox/events.py modified: combox/silo.py
Diffstat (limited to 'combox/events.py')
-rw-r--r--combox/events.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/combox/events.py b/combox/events.py
index 3ef4386..91be1a4 100644
--- a/combox/events.py
+++ b/combox/events.py
@@ -54,13 +54,6 @@ class ComboxDirMonitor(LoggingEventHandler):
self.housekeep()
- def silo_update(self):
- """
- Re-reads the silo from disk.
- """
- self.silo.reload()
-
-
def housekeep(self):
"""Recursively traverses combox directory, discovers changes and updates silo and node directories.
@@ -76,7 +69,6 @@ class ComboxDirMonitor(LoggingEventHandler):
updated and the file's shards are updated.
"""
- self.silo_update()
print "combox is housekeeping."
print "Please don't make any changes to combox directory now."
print "Thanks for your patience."
@@ -119,7 +111,6 @@ class ComboxDirMonitor(LoggingEventHandler):
def on_moved(self, event):
super(ComboxDirMonitor, self).on_moved(event)
- self.silo_update()
if event.is_directory:
# creates a corresponding directory at the node dirs.
@@ -134,7 +125,6 @@ class ComboxDirMonitor(LoggingEventHandler):
def on_created(self, event):
super(ComboxDirMonitor, self).on_created(event)
- self.silo_update()
file_node_path = node_path(event.src_path, self.config,
not event.is_directory)
@@ -152,7 +142,6 @@ class ComboxDirMonitor(LoggingEventHandler):
def on_deleted(self, event):
super(ComboxDirMonitor, self).on_deleted(event)
- self.silo_update()
file_node_path = node_path(event.src_path, self.config,
not event.is_directory)
@@ -170,7 +159,6 @@ class ComboxDirMonitor(LoggingEventHandler):
def on_modified(self, event):
super(ComboxDirMonitor, self).on_modified(event)
- self.silo_update()
if event.is_directory:
# do nothing
@@ -201,13 +189,6 @@ class NodeDirMonitor(LoggingEventHandler):
self.silo = ComboxSilo(self.config, dblock)
- def silo_update(self):
- """
- Re-reads the silo from disk.
- """
- self.silo.reload()
-
-
def shardp(self, path):
"""Returns True if `path' is a shard
@@ -234,7 +215,6 @@ class NodeDirMonitor(LoggingEventHandler):
location in the combox directory.
"""
- self.silo_update()
print "combox node monitor is housekeeping."
print "Please don't make any changes to combox directory now."
@@ -289,7 +269,6 @@ class NodeDirMonitor(LoggingEventHandler):
def on_moved(self, event):
super(NodeDirMonitor, self).on_moved(event)
- self.silo_update()
src_cb_path = cb_path(event.src_path, self.config)
dest_cb_path = cb_path(event.dest_path, self.config)
@@ -309,7 +288,6 @@ class NodeDirMonitor(LoggingEventHandler):
def on_created(self, event):
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
@@ -336,7 +314,6 @@ class NodeDirMonitor(LoggingEventHandler):
def on_deleted(self, event):
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
@@ -357,7 +334,6 @@ class NodeDirMonitor(LoggingEventHandler):
def on_modified(self, event):
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