Exemplo n.º 1
0
 def flush(self):
     """Delete all run-time data generated by this crawler."""
     Tag.delete(self.name)
     Event.delete(self.name)
     Result.delete(self.name)
     session.commit()
     signals.crawler_flush.send(self)
Exemplo n.º 2
0
 def flush(self):
     """Delete all run-time data generated by this crawler."""
     Queue.flush(self)
     Tag.delete(self)
     Event.delete(self)
     CrawlerState.flush(self)
     CrawlerRun.flush(self)
Exemplo n.º 3
0
    def run(self, incremental=None, run_id=None):
        """Queue the execution of a particular crawler."""
        state = {
            'crawler': self.name,
            'run_id': run_id,
            'incremental': settings.INCREMENTAL
        }
        if incremental is not None:
            state['incremental'] = incremental

        # Cancel previous runs:
        self.cancel()
        # Flush out previous events:
        Event.delete(self)
        Queue.queue(self.init_stage, state, {})
Exemplo n.º 4
0
 def flush_events(self):
     Event.delete(self)
Exemplo n.º 5
0
 def flush(self):
     """Delete all run-time data generated by this crawler."""
     self.queue.cancel()
     Event.delete(self)
     Crawl.flush(self)