Beispiel #1
0
 def _register_pending_indexes(self):
     if not self.pending_indexes:
         return
     if not db_table_exists(RegisteredIndex._meta.db_table):
         return
     for query_index in self.pending_indexes:
         self.index_tasks.register_index(query_index)
     self.pending_indexes = set()
Beispiel #2
0
 def register_index(self, query_index):
     if self._tables_exist or db_table_exists(
         RegisteredIndex._meta.db_table
     ):  # if the table doesn't exists then we are likely syncing the db
         self._tables_exist = True
         self.index_tasks.register_index(query_index)
         self._register_pending_indexes()
     else:
         self.pending_indexes.add(query_index)