diff --git a/main.go b/main.go index fda0b26..8671727 100644 --- a/main.go +++ b/main.go @@ -176,10 +176,10 @@ func main() { // {{{ func scheduleHandler() { // {{{ // Wait for the approximate minute. wait := 60000 - time.Now().Sub(time.Now().Truncate(time.Minute)).Milliseconds() - logger.Info("schedule", "wait", wait/1000) time.Sleep(time.Millisecond * time.Duration(wait)) tick := time.NewTicker(time.Minute) for { + <-tick.C for _, event := range ExpiredSchedules() { notificationManager.Send( event.UserID, @@ -193,7 +193,6 @@ func scheduleHandler() { // {{{ ), ) } - <-tick.C } } // }}} @@ -765,7 +764,7 @@ func keyCounter(w http.ResponseWriter, r *http.Request, sess *session.T) { // {{ func notificationAcknowledge(w http.ResponseWriter, r *http.Request, sess *session.T) { // {{{ logger.Info("webserver", "request", "/notification/ack") var err error - w.Header().Add("Access-Control-Allow-Origin", "*") + err = AcknowledgeNotification(r.URL.Query().Get("uuid")) if err != nil { @@ -777,5 +776,4 @@ func notificationAcknowledge(w http.ResponseWriter, r *http.Request, sess *sessi "OK": true, }) } // }}} - // vim: foldmethod=marker diff --git a/version b/version index 4aa0e0a..a682cfb 100644 --- a/version +++ b/version @@ -1 +1 @@ -v26 +v25