Esempio n. 1
0
 def _init_db(self):
     """We need this to be executed each time we are in a new process"""
     self.__conn_refs = {}
     self.__thread_local = threading.local()
     self.__thread_watcher = ThreadWatcher()
     self._storage = client_storage(**self.__storage_kwargs)
     self._db = DB.db_factory(self._storage, **self.__db_kwargs)
     self._conn_open()
Esempio n. 2
0
    def _init_db(self):
        """We need this to be executed each time we are in a new process"""
        if self._autoreindex:
            subscribers.init()

        Random.atfork()

        self.__conn_refs = {}
        self.__thread_local = threading.local()
        self.__thread_watcher = ThreadWatcher()
        self._storage = client_storage(**self.__storage_kwargs)
        self._db = SubDB(self._storage, **self.__db_kwargs)
        self._conn_open()