Exemplo n.º 1
0
    def refresh(self):
        # Any time we're doing a refresh, we're making sure that the
        # index is ready to be queried.  Given that, it's almost
        # always the case that we want to run all the generated tasks,
        # then refresh.
        from search.models import generate_tasks
        generate_tasks()

        get_es().refresh(settings.ES_INDEXES['default'], timesleep=0)
Exemplo n.º 2
0
    def refresh(self, timesleep=0):
        index = es_utils.WRITE_INDEX

        # Any time we're doing a refresh, we're making sure that the
        # index is ready to be queried.  Given that, it's almost
        # always the case that we want to run all the generated tasks,
        # then refresh.
        generate_tasks()

        get_es().refresh(index, timesleep=timesleep)
Exemplo n.º 3
0
    def test_tasks(self, index_fun):
        """Tests to make sure tasks are added and run"""
        q = question()
        # Don't call self.refresh here since that calls generate_tasks().

        eq_(index_fun.call_count, 0)

        q.save()
        generate_tasks()

        eq_(index_fun.call_count, 1)
Exemplo n.º 4
0
    def test_tasks(self, index_fun):
        """Tests to make sure tasks are added and run"""
        q = question()
        # Don't call self.refresh here since that calls generate_tasks().

        eq_(index_fun.call_count, 0)

        q.save()
        generate_tasks()

        eq_(index_fun.call_count, 1)
Exemplo n.º 5
0
    def refresh(self, run_tasks=True):
        index = es_utils.WRITE_INDEX

        if run_tasks:
            # Any time we're doing a refresh, we're making sure that
            # the index is ready to be queried. Given that, it's
            # almost always the case that we want to run all the
            # generated tasks, then refresh.
            generate_tasks()

        get_es().refresh(index)
        get_es().health(wait_for_status='yellow')
Exemplo n.º 6
0
    def refresh(self, run_tasks=True):
        index = es_utils.WRITE_INDEX

        if run_tasks:
            # Any time we're doing a refresh, we're making sure that
            # the index is ready to be queried. Given that, it's
            # almost always the case that we want to run all the
            # generated tasks, then refresh.
            generate_tasks()

        get_es().refresh(index)
        get_es().health(wait_for_status='yellow')