Compare commits

..

2 Commits

Author SHA1 Message Date
Magnus Åhall
eea0b1c0f6 Bumped to v26 2024-03-30 17:59:15 +01:00
Magnus Åhall
90b73edc34 Fixed CORS 2024-03-30 17:58:51 +01:00
2 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -1 +1 @@
v25
v26