Remove a bunch of unused cruft
This commit is contained in:
@@ -29,21 +29,14 @@ func NewCrawler(conf *Config, tasks *Dispatcher, db Store, indexer Indexer) (Cra
|
||||
}
|
||||
|
||||
func (c *crawler) loop() {
|
||||
for {
|
||||
select {
|
||||
case url, ok := <-c.queue:
|
||||
if !ok {
|
||||
log.Debugf("crawler shutting down...")
|
||||
return
|
||||
}
|
||||
log.Debugf("crawling %s", url)
|
||||
uuid, err := c.tasks.Dispatch(NewCrawlTask(c.conf, c.db, c.indexer, url))
|
||||
if err != nil {
|
||||
log.WithError(err).Error("error creating crawl task for %s", url)
|
||||
} else {
|
||||
taskURL := URLForTask(c.conf.BaseURL, uuid)
|
||||
log.WithField("uuid", uuid).Infof("successfully created crawl task for %s: %s", url, taskURL)
|
||||
}
|
||||
for url := range c.queue {
|
||||
log.Debugf("crawling %s", url)
|
||||
uuid, err := c.tasks.Dispatch(NewCrawlTask(c.conf, c.db, c.indexer, url))
|
||||
if err != nil {
|
||||
log.WithError(err).Error("error creating crawl task for %s", url)
|
||||
} else {
|
||||
taskURL := URLForTask(c.conf.BaseURL, uuid)
|
||||
log.WithField("uuid", uuid).Infof("successfully created crawl task for %s: %s", url, taskURL)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user