Compare commits
2 commits
a6c94ac7ca
...
aee1c25f54
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aee1c25f54 | ||
|
|
7de9feea58 |
3 changed files with 4 additions and 5 deletions
6
main.go
6
main.go
|
|
@ -175,10 +175,9 @@ func main() { // {{{
|
||||||
} // }}}
|
} // }}}
|
||||||
func scheduleHandler() { // {{{
|
func scheduleHandler() { // {{{
|
||||||
// Wait for the approximate minute.
|
// Wait for the approximate minute.
|
||||||
//wait := 60000 - time.Now().Sub(time.Now().Truncate(time.Minute)).Milliseconds()
|
wait := 60000 - time.Now().Sub(time.Now().Truncate(time.Minute)).Milliseconds()
|
||||||
//time.Sleep(time.Millisecond * time.Duration(wait))
|
time.Sleep(time.Millisecond * time.Duration(wait))
|
||||||
tick := time.NewTicker(time.Minute)
|
tick := time.NewTicker(time.Minute)
|
||||||
tick = time.NewTicker(time.Second*5)
|
|
||||||
for {
|
for {
|
||||||
<-tick.C
|
<-tick.C
|
||||||
for _, event := range ExpiredSchedules() {
|
for _, event := range ExpiredSchedules() {
|
||||||
|
|
@ -761,7 +760,6 @@ func keyCounter(w http.ResponseWriter, r *http.Request, sess *session.T) { // {{
|
||||||
})
|
})
|
||||||
} // }}}
|
} // }}}
|
||||||
|
|
||||||
|
|
||||||
func notificationAcknowledge(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")
|
logger.Info("webserver", "request", "/notification/ack")
|
||||||
var err error
|
var err error
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ func (nm *Manager) AddService(userID int, service Service) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (nm *Manager) Send(userID int, uuid string, msg []byte) (err error) {
|
func (nm *Manager) Send(userID int, uuid string, msg []byte) (err error) {
|
||||||
|
|
||||||
services, found := nm.services[userID]
|
services, found := nm.services[userID]
|
||||||
if !found {
|
if !found {
|
||||||
return werr.New("No notification services defined for user ID %d", userID).WithCode("002-0008")
|
return werr.New("No notification services defined for user ID %d", userID).WithCode("002-0008")
|
||||||
|
|
|
||||||
2
version
2
version
|
|
@ -1 +1 @@
|
||||||
v22
|
v23
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue