Ejemplo n.º 1
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)
Ejemplo n.º 2
0
 def last_run(self):
     return CrawlerState.last_run(self)
Ejemplo n.º 3
0
 def latest_runid(self):
     return CrawlerState.latest_runid(self)
Ejemplo n.º 4
0
 def runs(self):
     return CrawlerState.runs(self)
Ejemplo n.º 5
0
 def op_count(self):
     """Total operations performed for this crawler"""
     return CrawlerState.op_count(self)
Ejemplo n.º 6
0
def log_operation_start(context):
    crawler = context.crawler
    stage = context.stage
    run_id = context.run_id
    CrawlerState.record_operation_start(crawler, stage)
    CrawlerRun.record_operation_start(crawler, run_id)
Ejemplo n.º 7
0
def log_operation_end(context):
    crawler = context.crawler
    run_id = context.run_id
    CrawlerState.record_operation_end(crawler)
    CrawlerRun.record_operation_end(crawler, run_id)