diff options
author | Benjamin Saller <bcsaller@objectrealms.net> | 2007-07-31 21:25:40 (GMT) |
---|---|---|
committer | Benjamin Saller <bcsaller@objectrealms.net> | 2007-07-31 21:25:40 (GMT) |
commit | 19c87943f135a4e3255b823c6f2dc2ffdebb39d2 (patch) | |
tree | 6daba8d0c0531cdeef568cdcf49af210a004960c /src/olpc/datastore/xapianindex.py | |
parent | 356b35a278f2969c333c8c7b85ae8ae35ebe0141 (diff) |
force shutdown on unmount (for USB drives)
this now ignores pending work, finishes only its current task and returns
should help with the DBus timeout in umount though the caller should call this async I think.
normally you'd want to know that the media was stable before pulling the key, w/o notification
or a sync call you can't know.
Diffstat (limited to 'src/olpc/datastore/xapianindex.py')
-rw-r--r-- | src/olpc/datastore/xapianindex.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/olpc/datastore/xapianindex.py b/src/olpc/datastore/xapianindex.py index d46e0c7..671035d 100644 --- a/src/olpc/datastore/xapianindex.py +++ b/src/olpc/datastore/xapianindex.py @@ -102,8 +102,8 @@ class IndexManager(object): self.backingstore = backingstore - def stop(self): - self.stopIndexer() + def stop(self, force=False): + self.stopIndexer(force) self.write_index.close() self.read_index.close() @@ -118,6 +118,7 @@ class IndexManager(object): if not self.indexer_running: return if not force: self.queue.join() self.indexer_running = False + # should terminate after the current task self.indexer.join() # flow control |