Esempio n. 1
0
    def _index_signal(self, signal_id):
        self.stdout.write(f'* Index Signal #{signal_id}')

        try:
            signal = Signal.objects.get(pk=signal_id)
        except Signal.DoesNotExist:
            self.stderr.write(f'* Signal #{signal_id} does not exists')
            return None

        if not self._dry_run:
            SignalDocument.init()
            signal_document = SignalDocument.create_document(signal)
            signal_document.save()
Esempio n. 2
0
 def _init_index(self):
     self.stdout.write('* Init the index')
     if not self._dry_run:
         SignalDocument.init()