Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorBenjamin Saller <bcsaller@objectrealms.net>2007-07-22 00:48:30 (GMT)
committer Benjamin Saller <bcsaller@objectrealms.net>2007-07-22 00:48:30 (GMT)
commitf1f0bbdfb486639812b0e04389feb67b83540b73 (patch)
tree67c2c4ae3cdf226b0df2a49f55633c4b8d7eebdc /bin
parentfd4056b0893b44f6ce13ab0fc94fede440f549a1 (diff)
improved importer used in USB cases
includes additional metadata -- ctime/mtime/title walk of content is now async -- results become available as indexed introduced a workaround to dbus.mainloop.run() blocking the other threads this is only a work around and not the intended way to fix this issue but it does allow the other threads to run which means you'll see indexing in the background.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/datastore-service22
1 files changed, 17 insertions, 5 deletions
diff --git a/bin/datastore-service b/bin/datastore-service
index 7dd87ce..2019793 100755
--- a/bin/datastore-service
+++ b/bin/datastore-service
@@ -49,6 +49,7 @@ ds = DataStore()
ds.registerBackend(backingstore.FileBackingStore)
ds.registerBackend(backingstore.InplaceFileBackingStore)
ds.mount(repo_dir)
+ds.complete_indexing()
# and run it
logger.info("Starting Datastore %s" % (repo_dir))
@@ -63,7 +64,18 @@ signal.signal(signal.SIGHUP, handle_shutdown)
signal.signal(signal.SIGTERM, handle_shutdown)
def main():
- try: mainloop.run()
+ # XXX: The context/sleep loop is a work around for what seems
+ # to be the mainloop blocking in such a way that the indexer
+ # thread doesn't run until new dbus messages come in...
+ # I intend to track this down post trial-2
+ # really awful
+ import time
+ context = mainloop.get_context()
+ try:
+ while True:
+ context.iteration(False)
+ time.sleep(0.025)
+
except KeyboardInterrupt:
ds.stop()
logger.info("DataStore shutdown by user")
@@ -72,9 +84,9 @@ def main():
logger.debug("Datastore shutdown with error",
exc_info=sys.exc_info())
-#main()
+main()
-import hotshot
-p = hotshot.Profile('hs.prof')
-p.run('main()')
+#import hotshot
+#p = hotshot.Profile('hs.prof')
+#p.run('main()')