From 67b6d3154c250cf1810bc90b4d6932513cdd87c7 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Thu, 04 Oct 2007 16:46:31 +0000 Subject: Revert #3180: Recreate the index on mount failure. --- diff --git a/NEWS b/NEWS index 5b76f1e..5025cf7 100644 --- a/NEWS +++ b/NEWS @@ -22,7 +22,6 @@ Snapshot ea13f75d6a Snapshot 7655f4d99a -* #3180: Recreate the index on mount failure. (tomeu) * #3374: Don't create another entry during async update. (tomeu) * #3058: Disable content indexing for Trial-3. (tomeu) diff --git a/src/olpc/datastore/backingstore.py b/src/olpc/datastore/backingstore.py index 1db6d72..293e5e9 100644 --- a/src/olpc/datastore/backingstore.py +++ b/src/olpc/datastore/backingstore.py @@ -305,27 +305,7 @@ class FileBackingStore(BackingStore): # This will ensure the fulltext and so on are all assigned im.bind_to(self) - - try: - im.connect(index_name) - except Exception, e: - # TODO: Try to recover in a smarter way than deleting the base - # dir and reinitializing the index. - - logging.error('Error while trying to load mount point %s: %s. ' \ - 'Will try to renitialize and load again.' % (self.base, e)) - - # Delete the base dir and its contents - for root, dirs, files in os.walk(self.base, topdown=False): - for name in files: - os.remove(os.path.join(root, name)) - for name in dirs: - os.rmdir(os.path.join(root, name)) - os.rmdir(root) - - self.initialize() - self.load() - return + im.connect(index_name) self.indexmanager = im -- cgit v0.9.1