diff --git a/main.go b/main.go index 8671727..fda0b26 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,6 +193,7 @@ func scheduleHandler() { // {{{ ), ) } + <-tick.C } } // }}} @@ -764,7 +765,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 { @@ -776,4 +777,5 @@ func notificationAcknowledge(w http.ResponseWriter, r *http.Request, sess *sessi "OK": true, }) } // }}} + // vim: foldmethod=marker diff --git a/version b/version index a682cfb..4aa0e0a 100644 --- a/version +++ b/version @@ -1 +1 @@ -v25 +v26