I have to send out thousands of reminders, any way to avoid a ticker every minute?
问题 I have a struct like: type Notifications struct { Id int Start *time.Time } notifications := db.GetNotifications() So now I need to send out these notifications whenever the time matches the current time. 1 2018-11-07 09:05:00 2 2018-11-07 09:05:00 3 2018-11-07 09:15:00 .. The simplest way for me to do this is with a ticker: ticker := time.NewTicker(30 * time.Second) defer ticker.Stop() for { <-ticker.C alerts := []Notification for _, n := range notifications { if n.Start == // same year,