Exemplo n.º 1
0
    def handle(self, *args, **options):

        self.verbosity = options["verbosity"]

        if options['command'] == 'reindex':
            index_reindex()
        elif options['command'] == 'optimize':
            index_optimize()
Exemplo n.º 2
0
    def handle(self, *args, **options):

        self.verbosity = options["verbosity"]
        with transaction.atomic():
            if options['command'] == 'reindex':
                index_reindex()
            elif options['command'] == 'optimize':
                index_optimize()
Exemplo n.º 3
0
    def test_index_optimize(self):
        Document.objects.create(title="test",
                                content="my document",
                                checksum="wow",
                                added=timezone.now(),
                                created=timezone.now(),
                                modified=timezone.now())

        tasks.index_optimize()
Exemplo n.º 4
0
 def handle(self, *args, **options):
     with transaction.atomic():
         if options['command'] == 'reindex':
             index_reindex(progress_bar_disable=options['no_progress_bar'])
         elif options['command'] == 'optimize':
             index_optimize()