Esempio n. 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())
}
Esempio n. 2
0
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()
}