示例#1
0
文件: server.go 项目: seihmd/q-o-c
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
文件: server.go 项目: seihmd/q-o-c
func startUp() {
	entries = mongo.GetRecentEntries()
	orgs = mongo.GetOrgsMap()
	UpdateBookmarkCountsTop(300)
	log.Println("end startUp")
}