Пример #1
0
func setCron() {
	c := cron.New()
	c.AddFunc("@every 30m", func() {
		entries = mongo.GetRecentEntries()
		orgs = mongo.GetOrgsMap()
		log.Println("update entries and orgs")
	})
	c.AddFunc("@every 30m", func() {
		UpdateBookmarkCountsTop(300)
		log.Println("update top300")
	})
	c.AddFunc("@midnight", func() {
		UpdateBookmarkCountsAll()
		log.Println("update all bookmarks")
	})
	c.Start()
}
Пример #2
0
func startUp() {
	entries = mongo.GetRecentEntries()
	orgs = mongo.GetOrgsMap()
	UpdateBookmarkCountsTop(300)
	log.Println("end startUp")
}