예제 #1
0
func launchScheduler(db *mgo.Database, settings *Settings) {

	scheduler := schedulers.NewBasicScheduler()

	scheduler.Handle(hubspider.New(db, settings.Languages)).Every(12 * time.Hour)

	log.Fatal(scheduler.Start())
}
예제 #2
0
파일: wiki.go 프로젝트: gnagel/spider
func main() {
	wikiHTMLSpider := &WikipediaHTMLSpider{"Albert Einstein"}
	wikiJSONSpider := &WikipediaJSONSpider{"Lionel Messi"}

	s := schedulers.NewBasicScheduler()
	s.Handle(wikiHTMLSpider).Every(30 * time.Second)
	s.Handle(wikiJSONSpider).Every(20 * time.Second)
	s.Start()
}