def start_consumer()

in ees_microsoft_teams/full_sync_command.py [0:0]


    def start_consumer(self, queue):
        """This method starts async calls for the consumer which is responsible for indexing documents to the
        Enterprise Search
        :param queue: Shared queue to fetch the stored documents
        """
        self.logger.debug("Starting consumer for indexing objects to Workplace Search")

        thread_count = self.config.get_value("enterprise_search_sync_thread_count")
        sync_es = SyncEnterpriseSearch(
            self.config, self.logger, self.workplace_search_custom_client, queue
        )

        self.create_and_execute_jobs(thread_count, sync_es.perform_sync, (), [])
        self.logger.info("Completed indexing of the Microsoft Teams objects")

        # The reason for adding all the permissions in every run rather than appending the latest changes is
        # because in the Enterprise Search version>=8, there is no endpoint to append permissions
        if sync_es.permission_list_to_index:
            member_dict = defaultdict(list)
            for permission_dict in sync_es.permission_list_to_index:
                member_dict[permission_dict["user"]].extend(permission_dict["roles"])
            sync_es.workplace_add_permission(member_dict)

        checkpoint = Checkpoint(self.logger, self.config)
        for checkpoint_data in sync_es.checkpoint_list:
            checkpoint.set_checkpoint(checkpoint_data["checkpoint_time"], checkpoint_data["indexing_type"],
                                      checkpoint_data["object_type"])