Selaa lähdekoodia

Revert to sync indexing.

Stefano Cossu 7 vuotta sitten
vanhempi
commit
90518a8148
1 muutettua tiedostoa jossa 9 lisäystä ja 4 poistoa
  1. 9 4
      lakesuperior/store_layouts/ldp_rs/lmdb_store.py

+ 9 - 4
lakesuperior/store_layouts/ldp_rs/lmdb_store.py

@@ -2,6 +2,7 @@ import hashlib
 import logging
 
 from contextlib import ContextDecorator, ExitStack
+from multiprocessing import Process
 from os import makedirs
 from os.path import exists, abspath
 from threading import Lock, Thread
@@ -74,10 +75,14 @@ class TxnManager(ContextDecorator):
             if len(self.store._data_queue):
                 self.store._apply_changes()
             if len(self.store._idx_queue):
-                #self.store._run_indexing()
-                job = Thread(target=self.store._run_indexing)
-                job.start()
-                logger.info('Started indexing job #{}'.format(job.ident))
+                # Synchronous.
+                self.store._run_indexing()
+                # Threading.
+                #job = Thread(target=self.store._run_indexing)
+                # Multiprocess.
+                #job = Process(target=self.store._run_indexing)
+                #job.start()
+                #logger.info('Started indexing job #{}'.format(job.ident))
 
 
 class LmdbStore(Store):